Skip to content

Support Digistump dtiny AVR framework#190

Merged
zackees merged 1 commit intomainfrom
fix/189-digispark-dtiny
Apr 22, 2026
Merged

Support Digistump dtiny AVR framework#190
zackees merged 1 commit intomainfrom
fix/189-digispark-dtiny

Conversation

@zackees
Copy link
Copy Markdown
Member

@zackees zackees commented Apr 22, 2026

Summary

TDD Notes

Red:

uv run soldr cargo test -p fbuild-packages dtiny

failed with:

no AVR framework registered for core 'dtiny'

Green:

uv run soldr cargo test -p fbuild-packages dtiny
uv run soldr cargo test -p fbuild-packages
uv run soldr cargo test -p fbuild-build avr::orchestrator::tests
uv run soldr cargo fmt --all -- --check

Also verified a disposable temp digispark-tiny project builds successfully with:

uv run soldr cargo run -p fbuild-cli -- build <temp-project> -e digispark-tiny --release --verbose

The temp project was removed after the run.

Fixes #189

Summary by CodeRabbit

  • New Features

    • Added support for two new AVR Arduino frameworks (dtiny and pro) powered by the Digistump Arduino core. Both frameworks are now fully registered and configured with appropriate core directory paths.
  • Tests

    • Added unit tests to ensure proper framework detection and validation of configuration parameters, including verification of core directory assignments for the newly added frameworks.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

📝 Walkthrough

Walkthrough

This pull request adds support for Digistump/Digispark AVR cores by registering two new framework mappings (dtiny and pro) in the AVR frameworks configuration file and validating them with unit tests.

Changes

Cohort / File(s) Summary
AVR Framework Configuration
crates/fbuild-packages/assets/avr_frameworks.json
Adds two new framework entries (dtiny, pro) that map to the Digistump AVR core, each specifying validation paths and core directories for their respective targets.
Framework Tests
crates/fbuild-packages/src/library/avr_framework.rs
Adds three unit tests validating that dtiny is registered in the embedded registry and that lookups for both dtiny and pro return correct GitHub repository owner, framework name, and core directory overrides.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

  • Issue #189: Directly addresses the requirement to support Digistump/Digispark dtiny AVR core, resolving the "no AVR framework registered for core 'dtiny'" build error for digispark-tiny boards.

Poem

🐰 Twitch twitch

Tiny cores now find their place,
Digistump enters fbuild's embrace,
dtiny, pro in frameworks we'll keep,
Digispark boards can now build and leap! 🌱🎯

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly matches the main objective: adding support for the Digistump dtiny AVR framework as required by issue #189.
Linked Issues check ✅ Passed The PR fully implements the requirements from issue #189: registers dtiny framework mapping, maps dtiny to cores/tiny directory, and adds regression test coverage for the missing lookup.
Out of Scope Changes check ✅ Passed All changes are directly aligned with issue #189 objectives: framework JSON mappings, unit tests, and supporting the digispark-tiny build flow.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/189-digispark-dtiny

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
crates/fbuild-packages/src/library/avr_framework.rs (1)

386-398: Tighten the GitHub assertions to lock the exact registry target.

contains("DigistumpArduino") would still pass for the wrong owner/repo basename. Since the mapping is the contract here, assert the exact github value and optionally the validation paths too.

Suggested test tightening
     fn test_digispark_dtiny_lookup() {
         let entry = lookup_entry("dtiny").unwrap();
-        assert!(entry.github.contains("DigistumpArduino"));
+        assert_eq!(entry.github, "ArminJo/DigistumpArduino");
         assert_eq!(entry.name, "digistump-avr-core");
+        assert_eq!(entry.validation_path, "cores/tiny/Arduino.h");
         assert_eq!(entry.core_dir.as_deref(), Some("tiny"));
     }

     #[test]
     fn test_digispark_pro_lookup() {
         let entry = lookup_entry("pro").unwrap();
-        assert!(entry.github.contains("DigistumpArduino"));
+        assert_eq!(entry.github, "ArminJo/DigistumpArduino");
         assert_eq!(entry.name, "digistump-avr-core");
+        assert_eq!(entry.validation_path, "cores/pro/Arduino.h");
         assert_eq!(entry.core_dir.as_deref(), Some("pro"));
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/fbuild-packages/src/library/avr_framework.rs` around lines 386 - 398,
The tests test_digispark_dtiny_lookup and test_digispark_pro_lookup currently
use assert!(entry.github.contains("DigistumpArduino")), which is too loose;
change these to assert the exact registry target by using
assert_eq!(entry.github, "<expected owner/repo>") for each case (and keep the
existing assert_eq! checks for entry.name and entry.core_dir), and optionally
add precise path checks if there are validation fields to assert; locate the
assertions in the test functions and replace the contains(...) checks with exact
equality against the expected github string returned by lookup_entry.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@crates/fbuild-packages/src/library/avr_framework.rs`:
- Around line 386-398: The tests test_digispark_dtiny_lookup and
test_digispark_pro_lookup currently use
assert!(entry.github.contains("DigistumpArduino")), which is too loose; change
these to assert the exact registry target by using assert_eq!(entry.github,
"<expected owner/repo>") for each case (and keep the existing assert_eq! checks
for entry.name and entry.core_dir), and optionally add precise path checks if
there are validation fields to assert; locate the assertions in the test
functions and replace the contains(...) checks with exact equality against the
expected github string returned by lookup_entry.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0aec4d43-a393-4172-ab70-106f6f2dafeb

📥 Commits

Reviewing files that changed from the base of the PR and between 61b18fe and 5812469.

📒 Files selected for processing (2)
  • crates/fbuild-packages/assets/avr_frameworks.json
  • crates/fbuild-packages/src/library/avr_framework.rs

@zackees zackees merged commit 888ec98 into main Apr 22, 2026
74 of 77 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Digistump/Digispark dtiny AVR core for digispark-tiny

1 participant