You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SK9822Controller (legacy addLeds path) still emits all-zero end clocks that #3669 declared invalid #3682
Legacy SK9822Controller still emits all-zero end clocks that #3669 declared invalid
What
Commit 34a86a7 (#3669, "fix(spi): use all-ones SK9822 end clocks") changed the channel-engine encoders (src/fl/chipsets/encoders/sk9822.h, apa102.h) to emit all-ones (0xFF) end clock frames, with the rationale (quoted from the code):
The vendor datasheet requires all ones for the end clocks. These clocks shift the final LED frame through a long cascade; a zero frame is not a substitute because it is itself a valid start-frame pattern.
The legacy controller path was not updated and still contradicts that contract. In src/fl/chipsets/apa102.h:
APA102ControllerHD (line ~286) also passes END_FRAME = 0x00000000 (base APA102Controller default is 0xFF000000, itself only one 0xFF byte per end DWord)
So a user driving SK9822 through classic FastLED.addLeds<SK9822, ...> gets zero end clocks: on long cascades the final LED frame is not fully shifted through, and the zero end frame can read as a new start frame — the exact failure #3669 fixed on the encoder path. The encoder path and the legacy controller path now disagree about the SK9822 wire contract, and the doc comments on the controllers ("different END_FRAME" vs APA102) codify the stale behavior.
Also note the base APA102Controller::endBoundary() writes (nLeds/32) + 1 DWords of the END_FRAME pattern FF 00 00 00 — only 8 of every 32 end-clock bits are ones even on the APA102 default path, which likewise falls short of the all-ones datasheet requirement that #3669 adopted.
Changing END_FRAME template defaults alters the wire output of a long-shipped controller for all existing users; that is a maintainer wire-protocol decision, not something to slip into an unrelated PR. Flagging it here instead (found during the code review for the #3681 implementation PR).
Suggested fix
Align the legacy controllers with the #3669 contract:
Consider 0xFFFFFFFF for the APA102 family end boundary as well (matches encodeAPA102*)
Update the stale "different END_FRAME" doc comments
Validation: tests/misc/spi_frame_protocol (asserts encoder/controller byte-for-byte parity per #3669) plus on-device verification on a >32-LED SK9822 cascade.
Activity