Repository navigation
fix(platform/lpc): address CodeRabbit follow-ups on #2872 (writeBit RX-ignore, writePixels context, stale comments) - #2876
Conversation
Closes #2875. CodeRabbit posted 6 findings on PR #2872 that landed without addressing. This PR sweeps 5 of them. 1. **spi_arm_lpc.h::writeBit() RX-ignore (correctness).** The single-bit transmit helper was the only path writing TXDATCTL without setting `FL_LPC_SPI_TXCTL_RXIGNORE`. Every call clocked data into RXDAT, and the driver never drained it — repeated bit writes (e.g. APA102 / SK9822 / SM16716 start-bit prefixes on long strips) would accumulate RXOV. Now ORs the flag in to match writeByte(). 2. **spi_arm_lpc.h::writePixels() / writeBytes() context forwarding (correctness).** Both bracketed paths accepted a `context` arg but dropped it before calling `D::postBlock(len)`. Every other SPI backend in `src/platforms/*/spi_*.h` forwards the value as `D::postBlock(len, context)`. Forwarded here so context-dependent adjuster cleanup runs and instantiation against 2-argument-only adjusters works. 3. **spi_arm_lpc.h MMIO cast (drive-by clippy).** `reinterpret_cast` on the SPI base address was already flagged by `ReinterpretCastChecker` against master; converted to the `(volatile T*)(base)` C-style pattern the linter allows for MMIO (matches `clockless_arm_lpc_plu.h::reg32`). 4. **fastpin_arm_lpc.h:36 stale comment.** GPIO-controller struct comment now reflects the modern LPC family (LPC8xx / LPC11Uxx / LPC15xx all at 0xA0000000). 5. **fastpin_arm_lpc.h:77 stale comment.** FastPin template comment widened from "LPC8xx pins" to "modern LPC GPIO pins" with the PORT0-only caveat preserved. 6. **README.md item count.** Implementation map summary said "14 items" but the table has 15 rows (Stage 4.1 split into two during #2872). Corrected to 15 with accurate per-owner subtotals. ## Skipped finding CR also suggested moving the `ARMHardwareSPIOutput` method bodies out of `spi_arm_lpc.h` into a `.impl.hpp`. That conflicts with the repo's own `impl_hpp_includes_checker.py` lint rule: `.impl.hpp` files may only be included from `.impl.cpp.hpp` routers (non- template compile units). `ARMHardwareSPIOutput` is a class template — definitions must be visible at every instantiation point, which rules out the router pattern. This matches the other template SPI drivers in `src/platforms/arm/*/spi_*.h`. Added an inline comment to the header explaining the deviation. The non-template SPI drivers (`spi_hw_*nrf52.cpp.hpp` etc.) follow the `.cpp.hpp` convention exactly because they are non-template. ## Test plan - [x] `bash lint --cpp` clean (also cleared a pre-existing ReinterpretCastChecker violation on the SPI base-address cast). - [x] `bash test --cpp` — 310/310 host tests pass. - [ ] CI fbuild matrix LPC845 / LPC804 jobs (validate on push). - [ ] Hardware bring-up of the RX-ignore fix is **not** required for this PR — Stage 3 (#2845) covers scope-measured timing and is maintainer-only. The Finding 1 fix is a register-flag correctness issue verifiable by inspection.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR addresses six CodeRabbit follow-ups from issue ChangesLPC Platform Fixes and Documentation
Sequence Diagram(s)No sequence diagram needed for this PR. The changes consist of documentation clarifications, minor cast changes, flag additions to register writes, and parameter threading through existing call sites without introducing new control flow or component interactions. Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
…-up links (#2881) Closes #2845. The Stages 3 + 4 roadmap meta has run its course: - **3 items shipped** — Stage 4.1 (LPC11Uxx clockless), 4.2 (LPC15xx clockless), 4.3 (APA102 / SK9822 / WS2801 SPI). All three landed in #2872 with CodeRabbit follow-up fixes in #2876. - **6 items moved to fbuild** — Stage 3.1 - 3.4 + 3.7 + 3.8 now live under fbuild #456 (`Meta: LPC port completion — Stage 3 fbuild-side items`). - **3 items moved to hardware-gated follow-ups** — Stages 3.5 + 3.6 consolidated at FastLED #2880 (LPC845 hardware bring-up); Stage 4.4 at #2879 (multi-strip, blocked on Stage 2c). - **1 item moved to a code-only follow-up** — Stage 4.1 legacy at #2878 (the LPC1110/1112/1114/1115 fastpin against the 0x50000000 masked-access GPIO). - **2 items deferred** — Stage 4.5 (PIO donation; no upstream nxplpc platform exists) and Stage 4.6 (`fl::set_*` clock overrides; no concrete user requirement). Either reopens when there is a real ask. This PR is a documentation-only change to `src/platforms/arm/lpc/README.md`: 1. Adds GitHub Actions build-status badges for the existing `build-lpc845.yml` and `build-lpc804.yml` workflows in fbuild, matching the badge style used in the root FastLED README. 2. Notes that LPC11Uxx and LPC15xx compile against the same shared driver headers (fbuild #456 covers dedicated CI for those families). 3. Rewrites the implementation map so each row points at the smaller follow-up issue that owns it. 4. Reorganises the References section into Meta + Shipped + Open follow-ups + NXP user manuals. ## Test plan - [x] `bash lint --cpp` clean (README-only change; no source touched). - [x] All badge URLs and issue links typed against the workflows / issues confirmed live via `gh` before commit.
Closes #2875.
Summary
CodeRabbit posted 6 findings on PR #2872 that were not addressed pre-merge. This PR sweeps 5 of them and documents why the 6th cannot apply.
spi_arm_lpc.h::writeBit()missingFL_LPC_SPI_TXCTL_RXIGNORE(RXOV bug)writePixels()/writeBytes()dropcontextarg →D::postBlock(len, context).impl.hppimpl_hpp_includes_checker.pyfor template-heavy headers (see below)fastpin_arm_lpc.h:36stale "LPC8xx GPIO" commentfastpin_arm_lpc.h:77stale "LPC8xx pins" commentREADME.md"14 items" → "15 items"Why finding 3 was skipped
CR's suggestion: move
ARMHardwareSPIOutputmethod bodies intospi_arm_lpc.impl.hppper the "no function definitions insrc/**/*.h" coding guideline.When I attempted the split, the repo's own
impl_hpp_includes_checker.pylint rule fired:*.impl.hpp files must ONLY be included by *.impl.cpp.hpp router files.ARMHardwareSPIOutputis a class template — definitions must be visible at every instantiation point, so a non-template.impl.cpp.hpprouter cannot host them. This matches every other template SPI driver insrc/platforms/arm/*/spi_*.h(k20, mxrt1062, samd21, etc.). The non-template SPI drivers (spi_hw_2_nrf52.cpp.hppetc.) use the.cpp.hppconvention precisely because they're non-template.Added an inline
@filecomment to the header explaining the deviation.Drive-by
reinterpret_castviolation on the SPI base-address cast (flagged byReinterpretCastCheckeragainst master) — converted to the(volatile T*)(base)C-style pattern matchingclockless_arm_lpc_plu.h::reg32. Per CLAUDE.md's "fix all encountered errors immediately" rule.Test plan
bash lint --cpp— cleanbash test --cpp— 310/310 host tests passRelated
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
API Updates
Documentation