Skip to content

fix(spi-bitbang): derive whole-port clock words from pin polarity #5112

Closed

Description

@zackees

Follow-up from #5044. Part of #5024.

GenericSoftwareSPIOutput builds whole-port words with hival() | clock.mask() as clock high, which is backwards for active-low pins such as ClearCore IO0-IO3. The #5044 fix keeps ClearCore pins on atomic writes, so this code is not reached when ClearCore pins are used for both data and clock.

Still affected (from reading the code, not run): useAtomicWrites() checks only the data pin's kAtomicWrite. A user-defined non-atomic data pin on the same port as a ClearCore clock pin still gets the inverted word.

Wanted: derive clock high and low bits from the clock pin's own semantics. That would close the mixed-pin case and let ClearCore enable two-store streaming, with connector-level tests.

Activity

  1. added
    sanitized
    on Nov 6, 2026
  2. zackees commented on Nov 8, 2026

    @zackees
    MemberAuthor

    PR #5177 fixes the mixed-pin case. The generic writer now uses per-pin writes whenever either pin's policy is atomic, so a ClearCore clock beside a user data pin keeps its own hi()/lo(). Still open here:

    • Clock words are still built from mask, not from the clock pin's own polarity.
    • ClearCore two-store streaming is not enabled.
    • No connector-level hardware test.
  3. zackees commented on Nov 21, 2026

    @zackees
    MemberAuthor

    Closing: fixed on master in two parts. 9c70592 (#5177) keeps per-pin writes when the clock pin's policy is atomic. 12955b0 (#5242) builds combined whole-port words from the clock polarity.

  4. moved this from Triage to Done in FastLED Trackeron Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    sanitized

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions