Repository navigation
feat(esp8266): UART WS2812 engine as Bus::UART; retire FASTLED_ESP8266_UART (#4944) - #4952
Merged
Merged
Conversation
Agents that read AGENTS.md now get the same instructions as Claude. A relative symlink (not a copy) so the two can never drift.
…6_UART The UART1 (GPIO2) WS2812 driver was reachable only when FASTLED_ESP8266_UART was defined before FastLED.h -- the code-enabling define the tracking issue bans. Expose the engine as a template-selected channel driver instead. - Esp8266UartChannelDriver encodes a clockless channel's LED bytes into the UART1 6N1-inverted frame stream (four UART bytes per LED byte) and shifts them out, reusing the host-proven esp8266_uart:: helpers. canHandle() accepts only a clockless channel on GPIO2 (UART1 TX is fixed there). - uart_bus_traits.h specializes BusTraits<Bus::UART> + BusSupports<Bus::UART, ClocklessChipset>, so naming Bus::UART keeps the TU and everything else dead-strips (#2428). - The driver is deliberately NOT registered by enableAllDrivers(): selection is explicit (add<Bus::UART, ClocklessChipset>() or enableDriver<Bus::UART>()), so an ordinary pin-2 clockless strip keeps the bit-bang driver. - Retire FASTLED_ESP8266_UART: fastled_esp8266.h now includes the UART header and its bus_traits unconditionally; the define is a no-op. - compile_test.hpp covers the Bus::UART specialization; example + READMEs updated to the define-free usage. Verified: bash compile esp8266 --examples Blink,Esp8266Uart both succeed. Refs #4944, #4949.
|
Caution Review failedThe pull request is closed. Finishing Touches
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 |
Member
Author
Memory check (
|
| master | this stack | Δ | |
|---|---|---|---|
| image_flash | 264,671 B | 264,667 B | -4 B |
| attributed flash | 203,252 B | 203,249 B | -3 B |
| RAM | 6,808 B | 6,808 B | 0 B |
No memory regression: the unused ESP8266 engines are dead-stripped (template selection + linker elimination), so naming none of them costs ~nothing, as intended (#2428).
TKDFusion
pushed a commit
to TKDFusion/Software-FastLED-FASTLED
that referenced
this pull request
Nov 8, 2026
…rule (FastLED#4940) Umbrella for the ESP8266 define-elimination epic (FastLED#4949): state the rule and guard it. - agents/docs/cpp-standards.md: new REQUIRED section 'Driver selection is by template, never a code-enabling define' with the BusTraits/BusSupports shape and the retired offenders (FASTLED_ESP8266_UART, FASTLED_ALL_PINS_HARDWARE_SPI, FL_ESP8266_EMBEDDED_FS). - ci/lint_cpp/driver_enable_define_checker.py (new): a Python FileContentChecker that flags a preprocessor guard wrapping a 'platforms/...' include under src/platforms/** in an FL_*/FASTLED_* macro -- the code-enabling-define shape. The guards shipping today are grandfathered in driver_enable_define_amnesty.txt (regenerate with --generate-amnesty); new ones fail. Registered in run_all_checkers.py. - ci/tests/test_driver_enable_define_checker.py (new): flagged/allowed cases plus a tree-wide check that the amnesty still covers src/platforms. Wired into PY_SMOKE (guard in test_native_ci_modes.py bumped 9 -> 10). The three conversions land in FastLED#4951 / FastLED#4952 / FastLED#4953; this PR is the rule + guard. Refs FastLED#4940, FastLED#4949.
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.
Stacked on #4951 (#4942). Fixes #4944. Part of #4949.
Problem
The UART1 (GPIO2) WS2812 driver was compiled in but only reachable when
FASTLED_ESP8266_UARTwas defined beforeFastLED.h— the code-enabling definethe tracking issue bans.
Change (template selection, not a code-enabling define)
uart_channel_driver.{h,cpp.hpp}(new) —Esp8266UartChannelDriverencodes a clockless channel's LED bytes into the UART1 6N1-inverted frame
stream (four UART bytes per LED byte, two LED bits per frame) and shifts them
out, reusing the proven
esp8266_uart::helpers.canHandle()accepts only aclockless channel on GPIO2 (UART1 TX is fixed there).
uart_bus_traits.h(new) — specializesBusTraits<Bus::UART>+BusSupports<Bus::UART, ClocklessChipset>; namingBus::UARTkeeps the TU,everything else dead-strips (feat(channels): compile-time Bus binding via templated ChannelConfig (eliminates Channel API binary bloat) #2428).
FastLED.enableAllDrivers()— a user selects it withadd<Bus::UART, ClocklessChipset>()/enableDriver<Bus::UART>(), so anordinary pin-2 clockless strip keeps the bit-bang driver (no behavior change).
FASTLED_ESP8266_UART—fastled_esp8266.hincludes the UARTheader + its
bus_traitsunconditionally; the define is a no-op.compile_test.hppcovers theBus::UARTspecialization; theexamples/Esp8266Uartsketch + READMEs move to define-free usage (legacycontroller and channel-API paths both shown).
Test plan / evidence
bash compile esp8266 --examples Blink,Esp8266Uartboth succeed (the UARTdriver TU compiles in the unity build).
compile_test.hppasserts run on every ESP8266 build.acceptance step (needs a board).