Regression shipped in 3.10.9 from #4917 (c3cc64d): ClocklessController
passed the logical DATA_PIN to esp8266_clockless::sendPixel, which writes
GPOS/GPOC/GP16O for a raw GPIO number. Under FASTLED_ESP8266_D1_PIN_ORDER
or FASTLED_ESP8266_NODEMCU_PIN_ORDER the strip was driven on the wrong pad
(NodeMCU D2 toggled GPIO2 instead of GPIO4). 3.10.8 used FastPin<>::mask()
and was correct.
Pass FastPin<DATA_PIN>::kRealPin, which both the native and the forced
software-pin _ESPPIN providers define. The default RAW pin order is
unchanged (byte-identical Blink firmware). The block clockless driver
uses fixed GPIO12-15/4/5 lanes and the channel drivers take runtime GPIO
numbers, so they do not share this bug.
Summary
Fixes a regression that shipped in 3.10.9, introduced by #4917 (c3cc64d).
ClocklessController(src/platforms/esp/8266/clockless_esp8266.h) passed the logicalDATA_PINtoesp8266_clockless::sendPixel. That function writesGPOS/GPOC/GP16Ofor a raw GPIO number (1u << (pin & 0x0F),pin >= 16). WithFASTLED_ESP8266_D1_PIN_ORDERorFASTLED_ESP8266_NODEMCU_PIN_ORDER, LEDs were driven on the wrong pad. For example, NodeMCU D2 toggled GPIO2 instead of GPIO4. 3.10.8 usedFastPin<DATA_PIN>::mask()and was correct.The fix passes
FastPin<DATA_PIN>::kRealPin. Both the native_ESPPINand the forced-software-pins_ESPPIN(#5258) define it.Production path
FastLED.addLeds<WS2812, PIN>()on ESP8266 ->ClocklessController<PIN,...>::showRGBInternal->sendPixel. Any sketch that opts into the D1 or NodeMCU pin order is affected.Audit
clockless_block_esp8266.hdrives fixed lanes (GPIO12-15, 4, 5) throughPIN_MASKandsport/cport.FIRST_PINnever selects a pad, so it does not have this bug.spi_output_template.h) already maps throughkRealPin.Evidence
bash compile esp8266 --examples Blink(fbuild, xtensa-lx106 gcc 10.3), with firmware.bin compared:079e8a8f...).FL_PIN_CLOCKLESS_1=2, i.e. D2 = GPIO4), after: byte-identical to RAW GPIO4. Before the fix it differed in 6 bytes, because it drove GPIO2.PIN_DATA=2(GPIO16 / GP16O path): builds.FASTLED_FORCE_SOFTWARE_PINS+ NodeMCU order: builds.Tests
ci/tests/test_esp8266_clockless_real_gpio.py. It fails on master and passes with the fix.ci/tests/test_esp8266_forced_software_pins.pyandtest_esp8266_clockless_wait_time.pypass.bash lintis clean.Summary by CodeRabbit
Bug Fixes
Tests