Repository navigation
fix(chipsets): restore TM1829 FLIP + WAIT_TIME dropped in refactor (#8) - #3797
Merged
Merged
Conversation
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]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe 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. ChangesTM1829 configuration
Estimated code review effort: 2 (Simple) | ~10 minutes ✨ Finishing Touches📝 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 |
This was referenced Aug 1, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Commit
fc0c3d5("refactor(chipsets): use platform-specificClocklessControllerImpl") sweptsrc/chipsets.hstripping trailing0, falsetemplate 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: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=500encoded.TX1813N1(#1362) derives from the 800 kHz controller and regressed with it.Fix
Restore
0, true, 500on both controllers, plus a@noterecording the current backend limitation.Impact
WAIT_TIME=500CMinWait<WAIT_TIME>on ~20 backends (AVR, ATtiny, ARM bit-bang paths)FLIP=trueclockless_arm_nrf52.h:53-54)ESP32 driver paths derive latch timing from
TIMING::RESETand 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
FLIPand ignores it, and the newerfl::channelspath has no polarity concept at all (ChipsetTimingConfigcarries onlyt1/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, alwaysfalseirmt4_peripheral.h:177—setGpio(..., bool invert), callers passfalseii2s_peripheral_esp32dev.h:107—u16 mInvertMask, always0The missing plumbing is a polarity bool on
ChipsetTimingConfig/ClocklessChipset(plusoperator==andmakeTimingConfig) bridged fromFLIP, then wired into those three flags.Verification
bash test --cpp— 357/357 pass (274 unit, 83 examples)bash lint— cleanRefs #8, #1362
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Documentation