Repository navigation
fix(color): managed non-HD APA102/SK9822 hold the field at 31 under global brightness (#4457) - #4464
Conversation
…lobal brightness (#4457) #4457: with FASTLED_USE_GLOBAL_BRIGHTNESS=1, encodeAPA102_AutoBrightness / encodeSK9822_AutoBrightness derive one strip-wide 5-bit field from the first pixel's peak and rescale only that pixel, dimming the rest by field/31. On a colour-managed channel that is a second shaping stage on drives the pipeline already solved -- the one exception the P8 encoder table named against section 6. Managed half: ColorPipelineHooks::encodeManagedSpi now owns non-HD APA102/DOTSTAR/HD107/SK9822 and always encodes with field 31 (B1's conservative treatment), independent of the option. With the option off that is exactly the encoder's own path, so default output is unchanged; linked only when a profile is bound. Legacy half: left as it is. It is long-standing behaviour of an opt-in build flag, and changing it would change the output of every sketch that sets it. Recorded in the encoder table. Test: the hook, called directly, claims each of the four chips and emits field 31 with the pipeline's codes (fails if it declines one -- a Channel-level test could not tell the paths apart with the option off). Builds with -DFASTLED_USE_GLOBAL_BRIGHTNESS=1 (esp32s3 ColorProfile). 307/307 unit, 95/95 examples; uno Blink unchanged. Closes #4457. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
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 (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughManaged APA102, DOTSTAR, HD107, and SK9822 encoding now uses ChangesManaged SPI field handling
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
…r instantiation Calling encodeAPA102/encodeSK9822 from the hook made the compiler outline them (+135 B each) in place of the copies inlined into writeAPA102 / writeSK9822 (-114 B each): +55 B on ESP32-S3 Blink, which binds no profile. The hook now uses writeFiveBitWide pinned at field 31, which it already links for the HD chips: same framing, one quantization from the 16-bit drive, and ESP32-S3 Blink byte-identical to master. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
#4457: with FASTLED_USE_GLOBAL_BRIGHTNESS=1, encodeAPA102_AutoBrightness /
encodeSK9822_AutoBrightness derive one strip-wide 5-bit field from the
first pixel's peak and rescale only that pixel, dimming the rest by
field/31. On a colour-managed channel that is a second shaping stage on
drives the pipeline already solved -- the one exception the P8 encoder
table named against section 6.
Managed half: ColorPipelineHooks::encodeManagedSpi now owns non-HD
APA102/DOTSTAR/HD107/SK9822 and always encodes with field 31 (B1's
conservative treatment), independent of the option. With the option off
that is exactly the encoder's own path, so default output is unchanged;
linked only when a profile is bound.
Legacy half: left as it is. It is long-standing behaviour of an opt-in
build flag, and changing it would change the output of every sketch that
sets it. Recorded in the encoder table.
Test: the hook, called directly, claims each of the four chips and emits
field 31 with the pipeline's codes (fails if it declines one -- a
Channel-level test could not tell the paths apart with the option off).
Builds with -DFASTLED_USE_GLOBAL_BRIGHTNESS=1 (esp32s3 ColorProfile).
307/307 unit, 95/95 examples; uno Blink unchanged.
Closes #4457.
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Documentation