Repository navigation
fix(color): hold the HD 5-bit field fixed on a managed channel (P8 B1) - #4441
Conversation
APA102-HD and SK9822-HD take a colour triple from the RGB range and a per-strip brightness from loadRGBScaleAndBrightness(), mapped to the 5-bit field. On a managed channel the triple is the pipeline's drives, which already carry brightness as C4's flux scalar -- and ColorManagedPixelSource forwarded the controller's brightness and colour scale as well, so the strip was dimmed twice: a quarter of the light at half brightness, a sixteenth at a quarter. The managed source now reports full scale (colour 255/255/255, brightness 255 -> field 31). That is B1's conservative treatment for SK9822 and chips without current-vs-chromaticity data: the field is held fixed and the pipeline is the only amplitude stage. An APA102 joint code/field solve needs B1's flicker floor and is left for that decision. RED: at controller brightness 64 the managed source reported brightness 64 and scale (255,192,128); now 255 and (255,255,255), with a legacy-controller control that still reports 64. Part of #4042 (P8). 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 (3)
Included review availability: Your plan provides up to 8 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe managed pixel source now reports full-scale colour and brightness values under ChangesManaged brightness scaling
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to Managed HD channels now avoid double dimming while legacy controller behavior remains covered; no actionable merge risk remains. 🚥 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 |
Problem
APA102-HD and SK9822-HD encode a colour triple from the RGB range plus a per-strip brightness from
loadRGBScaleAndBrightness(), mapped to the 5-bit field.On a managed channel the triple is the pipeline's drives, which already carry brightness as C4's flux scalar.
ColorManagedPixelSource::loadRGBScaleAndBrightness()also forwarded the controller's brightness and colour scale, so the strip was dimmed twice:This is the gap the #4042 comments trace (the HD path "does not do HD gamma at all", with brightness applied twice).
Fix
The managed source now reports full scale: colour 255/255/255, and brightness 255, which becomes field 31.
This is B1's conservative treatment, prescribed for SK9822 and for any chip without current-vs-chromaticity data. The 5-bit field is held fixed, and the pipeline is the only amplitude stage.
It needs no open decision. The APA102 joint code/field solve would use the field for low-light resolution, but it depends on B1's flicker floor (a maintainer decision), so it stays open. The header comment now says so.
Validation
RED → GREEN. With the controller at brightness 64:
A legacy-controller control in the same test still reports 64, so the check is about the managed source rather than a harness that never dims.
bash test color_managed_sourcepasses, and so does--debug(ASAN/UBSAN).bash test --cpp: 307/307 unit, 94/94 examples.bash lintpasses.Part of #4042 (P8).
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests