Skip to content

fix(chipsets): restore TM1829 FLIP + WAIT_TIME dropped in refactor (#8) - #3797

Merged
zackees merged 1 commit into
masterfrom
fix/issue-8-tm1829-flip
Aug 1, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/issue-8-tm1829-flip

Conversation

@zackees

@zackees zackees commented Aug 1, 2026 •

Copy link
Copy Markdown
Member

Problem

Commit fc0c3d5 ("refactor(chipsets): use platform-specific ClocklessControllerImpl") swept src/chipsets.h stripping trailing 0, false template defaults. Harmless for every other chipset — but TM1829 was the only chipset passing non-default values, 0, true, 500, and those were stripped along with the rest:

-class TM1829Controller800Khz  : public FASTLED_CLOCKLESS_CONTROLLER<..., RGB_ORDER, 0, true, 500> {};
+class TM1829Controller800Khz  : public ClocklessControllerImpl<..., RGB_ORDER> {};
-class TM1829Controller1600Khz : public FASTLED_CLOCKLESS_CONTROLLER<..., RGB_ORDER, 0, true, 500> {};
+class TM1829Controller1600Khz : public ClocklessControllerImpl<..., RGB_ORDER> {};

The TM1829 drives an inverted line (LOW-then-HIGH per bit, idling HIGH) and needs a 500 µs latch gap — that is exactly what FLIP=true, WAIT_TIME=500 encoded. TX1813N1 (#1362) derives from the 800 kHz controller and regressed with it.

Fix

Restore 0, true, 500 on both controllers, plus a @note recording the current backend limitation.

Impact

Parameter Consumed by Effect of restore
WAIT_TIME=500 CMinWait<WAIT_TIME> on ~20 backends (AVR, ATtiny, ARM bit-bang paths) Latch gap restored broadly
FLIP=true only nRF52 PWM (clockless_arm_nrf52.h:53-54) True signal inversion restored on nRF52

ESP32 driver paths derive latch timing from TIMING::RESET and are unaffected either way.

Scope note — #8 stays open

This restores prior behavior; it does not complete TM1829 support. Every backend except nRF52 still accepts FLIP and ignores it, and the newer fl::channels path has no polarity concept at all (ChipsetTimingConfig carries only t1/t2/t3/reset).

Worth recording for whoever finishes this: the hardware inversion flags already exist and sit unused —

  • irmt5_peripheral.h:94 — bool invert_out, always false
  • irmt4_peripheral.h:177 — setGpio(..., bool invert), callers pass false
  • ii2s_peripheral_esp32dev.h:107 — u16 mInvertMask, always 0

The missing plumbing is a polarity bool on ChipsetTimingConfig/ClocklessChipset (plus operator== and makeTimingConfig) bridged from FLIP, then wired into those three flags.

Verification

  • bash test --cpp — 357/357 pass (274 unit, 83 examples)
  • bash lint — clean

Refs #8, #1362

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Improved TM1829 LED controller support at 800 kHz and 1600 kHz.
    • Corrected output signal inversion for compatible hardware.
    • Added the required 500 µs latch wait to improve data transmission reliability.
  • Documentation

    • Clarified TM1829 inversion behavior and documented the backend limitation.
    • Added a reference for 1600 kHz configuration details.

Commit fc0c3d5 ("refactor(chipsets): use platform-specific
ClocklessControllerImpl") swept src/chipsets.h stripping trailing
`0, false` template defaults. That is a no-op for every other chipset,
but TM1829 was the sole chipset passing non-default values —
`0, true, 500` — and those were stripped along with the rest.

The TM1829 drives an inverted line (LOW-then-HIGH per bit, idling HIGH)
and needs a 500us latch gap. Losing FLIP=true and WAIT_TIME=500 silently
regressed both TM1829Controller800Khz and TM1829Controller1600Khz, and
with them TX1813N1 (#1362), which derives from the 800kHz controller.

Impact of the restore:
- WAIT_TIME=500 is honored via `CMinWait<WAIT_TIME>` on ~20 backends
  (AVR, ATtiny, and the ARM bit-bang paths), so the latch gap comes back
  broadly. ESP32 driver paths derive latch from TIMING::RESET and are
  unaffected either way.
- FLIP=true is currently only consumed by the nRF52 PWM backend
  (clockless_arm_nrf52.h:53-54), which regains true signal inversion.

Every other backend still accepts FLIP and ignores it, so this restores
the previous behavior rather than completing TM1829 support. #8 stays
open for that; a note on the declaration records the limitation.

Refs #8

Co-Authored-By: Claude <[email protected]>
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Aug 1, 2026
@zackees
zackees merged commit bed4df1 into master Aug 1, 2026
10 of 12 checks passed
@zackees
zackees deleted the fix/issue-8-tm1829-flip branch August 1, 2026 03:54
@coderabbitai

coderabbitai Bot commented Aug 1, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9ad624a5-9e29-4509-bcef-1bdfdca1df93

📥 Commits

Reviewing files that changed from the base of the PR and between 62d4056 and af38a03.

📒 Files selected for processing (1)
  • src/chipsets.h

📝 Walkthrough

Walkthrough

The TM1829 800 kHz and 1600 kHz controllers now enable inverted output and use a 500 µs latch wait. Their documentation describes the inversion requirement and backend limitation.

Changes

TM1829 configuration

Layer / File(s) Summary
Update TM1829 controller declarations
src/chipsets.h
Both controller variants now pass FLIP=true and a 500 µs latch wait to ClocklessControllerImpl. Documentation records the inversion behavior and backend limitation.

Estimated code review effort: 2 (Simple) | ~10 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-8-tm1829-flip

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant