Repository navigation
fix(attiny): drop unreachable pin-map listings for 4KB parts (#973) - #3830
Merged
Merged
Conversation
ATtiny404 and ATtiny416 were listed twice in the #elif chain: once in the "ATtiny2YZ or ATtiny4YZ have very limited storage" arm, and again in the xy4 / xy6 pin-map arms below it. The chain reaches the limited-storage arm first, so the later listings were unreachable -- those parts never got a pin map and never could. Harmless at compile time, but actively misleading when reading the file: it reads as if 404/416 are supported. That misreading already happened on #973, where the family was reported as having pin maps for 412/414/416/417 when in fact every one of those lands in the no-pin-definitions arm. The limited-storage arm is correct for these parts, not a bug to fix the other way -- a minimal Blink links to 4885 bytes on this family, which a 4KB part cannot hold at all. Leaving FastPin<> unspecialized turns that into a compile error instead of a link-time overflow. So: remove the two dead listings and document the ordering constraint at the arm itself, so the next person does not re-add them. Provably inert. Rebuilt Blink for attiny1616 and attiny1604 and compared firmware.elf against the same builds from unmodified master: ATtiny1616 8feac31b8d6ab5e9... -> 8feac31b8d6ab5e9... identical ATtiny1604 17e30b0db565f98f... -> 17e30b0db565f98f... identical Co-Authored-By: Claude <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ATtiny pin mapping now excludes unsupported low-flash devices. ATtiny2YZ/4YZ devices stop before pin definitions, and ATtiny404 and ATtiny416 are removed from existing pin-map branches. ChangesATtiny pin-map exclusions
Estimated code review effort: 2 (Simple) | ~10 minutes ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while investigating #973.
ATtiny404andATtiny416are each listed twice in the#elifchain infastpin_attiny.h: once in the "ATtiny2YZ or ATtiny4YZ have very limited storage" arm (line 215), and again in thexy4/xy6pin-map arms below it (lines 218 / 231). The chain reaches the limited-storage arm first, so the later listings are unreachable — those parts never got a pin map and never could.Harmless at compile time, but actively misleading when reading the file: it scans as though 404/416 are supported. That misreading has already happened once — #973 was answered with "FastLED has pin maps for the full megaTinyCore family (ATtiny412/414/416/417/...)", when in fact every one of those four lands in the no-pin-definitions arm.
The limited-storage arm is correct — this is not a bug to fix the other way
A minimal
Blinklinks to 4885 bytes of flash on this family (measured,attiny1616). A 4KB part cannot hold the library at all. LeavingFastPin<>unspecialised turns that into a compile error rather than a link-time overflow, which is the better failure. Same reasoning that closed #581 for the ATtiny13.So the fix is to delete the two dead listings and document the ordering constraint at the arm itself, so nobody re-adds them.
Verification — provably inert
Rebuilt
Blinkfor both supported boards in this family and comparedfirmware.elfagainst the same build from unmodified master:8feac31b8d6ab5e9…8feac31b8d6ab5e9…17e30b0db565f98f…17e30b0db565f98f…Flash/RAM unchanged: 1616 = 4885 B / 257 B, 1604 = 4839 B / 225 B.
bash lintclean (only pre-existing warn-only violations).🤖 Generated with Claude Code
Summary by CodeRabbit