Repository navigation
fix(attiny85): compile the dither power reserve out on TINY, and gate TwinkleFox (#4478) - #4479
Conversation
… TwinkleFox #4450 added BINARY_DITHER's power-estimation reserve. Its bound is 64-bit arithmetic over every lit channel, which costs 468 B on an 8-bit AVR: exactly what pushed TwinkleFox past the ATtiny85's 8 KiB flash region (#4478). On FL_PLATFORM_HAS_TINY_MEMORY the reserve is now zero and neither it nor the arithmetic links; the show path drops the call as well. Every other tier keeps #4450's behaviour unchanged. TwinkleFox links again at 8,036 B of 8,192. That is 156 B of headroom, so a new workflow builds it for attiny85 on pull requests -- the two existing ATtiny85 workflows run on master pushes only, which is how the overflow landed unnoticed. Its triggers cover src/** rather than just the sketch, because the regression came from power_mgt. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: FastLED/FastLED/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change adds tiny-memory stubs for dither reserve calculations, excludes that reserve from tiny-platform power estimates, documents the behavior, and adds an ATtiny85 TwinkleFox build workflow with flash-overflow checking. ChangesATtiny85 size support
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 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 |
Closes #4478.
Regression
#4450 added BINARY_DITHER's power-estimation reserve.
dither_reserve_mW()counts lit channels and bounds them in 64-bit arithmetic; on an 8-bit AVR that codegen costs 468 B, andTwinkleFoxoverflowed the ATtiny85's 8 KiB flash region by exactly that:Reproduced on master before the change.
Fix
On
FL_PLATFORM_HAS_TINY_MEMORYthe reserve is zero and neither it nor its arithmetic links: both functions have tiny-tier definitions, andCFastLED::show()drops the call so nothing pulls them in. Every other tier is untouched, so #4450's electrical guarantee holds wherever the flash exists to pay for it.The tier carve-out matches how the colour pipeline is already excluded on TINY, and the header says so where the functions are declared.
Prevention gate
.github/workflows/check_attiny85_twinklefox.ymlbuildsattiny85 --examples TwinkleFoxon pull requests.build_attiny85.ymlandcheck_attiny85.ymlrun on master pushes only, which is why #4450 landed and only then turned the board workflow red. A link failure is the assertion:avr-ldexits non-zero on region overflow.Its trigger paths cover
src/**, not justexamples/TwinkleFox/**, because the regression came fromsrc/power_mgt.*andsrc/FastLED.cpp.hpp.Validation
attiny85 TwinkleFoxattiny85 Blinkuno TwinkleFox(low tier, keeps the reserve)bash test --cpp: 308/308 unit, 95/95 examples.bash lintpasses.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Build and Validation