Repository navigation
Conversation
…drivers Refactor the LCD_CAM SPI driver (ChannelDriverLcdSpi) and add a new clockless driver (ChannelDriverLcdClockless) for ESP32-S3. Both use ISR-driven 3-buffer ring architecture for chunked DMA streaming, modeled after the PARLIO driver. Key changes: - SPI driver: ISR callback transposes next chunk on DMA completion - Clockless driver: wave3/wave8 auto-select via canUseWave3(), uses wave3Transpose_16/wave8Transpose_16 for encoding in ISR context - Mock simulateTransmitComplete() drains full ISR callback chain - Chunk size capped at ~100 LEDs (SPI) / ~30 LEDs (clockless) - LCD clockless registered in channel manager, replacing misnamed "I2S" driver on ESP32-S3 22 new test cases across both drivers. All 299 tests pass, ASAN/LSAN/UBSAN clean, lint clean. Closes #2258 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…-spi Hardware bring-up for PR #2260 (LCD_CAM ISR-driven chunked DMA). Crash fix ChannelDriverLcdClockless defaulted dc_gpio=22 and clock_gpio=21. GPIO 22 does not exist on common ESP32-S3 packages, so esp_lcd_new_i80_bus -> lcd_i80_bus_configure_gpio -> gpio_func_sel hit an error-log path that detected heap poisoning and triggered a Guru Meditation panic. Changed both defaults to GPIO 0 (same convention as the legacy I2S LCD_CAM driver this replaces). autoresearch CLI --lcd now maps to LCD_CLOCKLESS (was the legacy I2S name). Added --lcd-spi mapping to LCD_SPI (APA102/SK9822 via LCD_CAM I80). Both auto-select the esp32s3 environment and are included in --all. autoresearch RX decoder AutoResearchTest.cpp recognises LCD_CLOCKLESS and reconstructs the RX timing for wave3 or wave8 encoding using the same fl::canUseWave3() eligibility check the firmware uses at runtime. GPIO pre-test timing Bumped RpcClient boot_wait from 3s to 8s and enabled drain_boot in gpio.py. The ESP32-S3 AutoResearch setup() takes ~5-7s before the RPC dispatcher is ready, so the old 3s wait raced the first ping against setup and produced intermittent GPIO PRE-TEST timeouts. Hardware verification (ESP32-S3 @ COM13, jumper GPIO 1 -> GPIO 2) LCD_SPI: 4/4 patterns pass (passed:true) LCD_CLOCKLESS: 4/4 patterns pass (passed:true, after GPIO fix) Host unit tests: 299/299 pass. Lint clean. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR introduces a new ESP32-S3 clockless LED driver using the LCD_CAM I80 bus, refactors the existing LCD_SPI driver to use ISR-driven chunked DMA streaming instead of single-buffer blocking, adds CLI support for the new driver variant, increases GPIO RPC timeouts, and provides comprehensive unit test coverage for both drivers. Changes
Sequence DiagramsequenceDiagram
participant App as Application
participant Driver as ChannelDriverLcdSpi<br/>(or Clockless)
participant ISR as ISR Handler
participant DMA as DMA Hardware
participant Ring as Ring Buffers
App->>Driver: enqueue(data)
App->>Driver: show()
activate Driver
Driver->>Ring: allocate ring buffers
Driver->>Ring: transpose chunk 0
Driver->>DMA: submit chunk 0 (register ISR)
deactivate Driver
DMA->>ISR: interrupt on chunk complete
activate ISR
alt more chunks exist
ISR->>Ring: transpose next chunk
ISR->>DMA: submit next chunk
else all chunks done
ISR->>Driver: set mStreamComplete flag
end
deactivate ISR
App->>Driver: poll()
alt stream complete
Driver->>Ring: free ring buffers
Driver-->>App: return READY
else transmitting
Driver-->>App: return DRAINING
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
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 |
Summary
Hardware bring-up for the LCD_CAM drivers added in #2260 (merged). Fixes a boot crash in
LCD_CLOCKLESSand wires the autoresearch CLI so--lcdand--lcd-spiboth pass on an ESP32-S3.Crash fix
ChannelDriverLcdClocklessdefaulteddc_gpio=22andclock_gpio=21. GPIO 22 does not exist on common ESP32-S3 packages, soesp_lcd_new_i80_bus→lcd_i80_bus_configure_gpio→gpio_func_selhit an error-log path that detected heap poisoning and triggered a Guru Meditation panic.Changed both defaults to GPIO 0, matching the legacy I2S LCD_CAM driver this replaces (the strapping pin tolerates being multiplexed to the unused PCLK/DC peripheral functions).
autoresearch CLI
--lcdnow maps toLCD_CLOCKLESS(was the legacyI2Sname).--lcd-spiflag maps toLCD_SPI(APA102/SK9822 via LCD_CAM I80).esp32s3environment and are included in--all.autoresearch RX decoder
examples/AutoResearch/AutoResearchTest.cppnow recognisesLCD_CLOCKLESSand reconstructs the RX timing for wave3 or wave8 encoding using the samefl::canUseWave3()eligibility check the firmware uses at runtime.GPIO pre-test timing
Bumped
RpcClientboot_waitfrom 3s to 8s and enableddrain_bootinci/autoresearch/gpio.py. The ESP32-S3 AutoResearchsetup()takes ~5-7s before the RPC dispatcher is ready, so the old 3s wait raced the first ping against setup and produced intermittentGPIO PRE-TEST TIMEOUTfailures.Hardware verification (ESP32-S3 @ COM13, jumper GPIO 1 → GPIO 2)
LCD_SPIpassed:true)LCD_CLOCKLESSpassed:true, after GPIO fix)Test plan
LCD_SPIsingle-driver hardware test passesLCD_CLOCKLESSsingle-driver hardware test passes (crash fixed)bash autoresearch --lcdend-to-end (blocked by a pre-existing FbuildSerialAdapter DTR/RTS race — tracked separately; direct JSON-RPC path is reliable)Follow-up to #2260.
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
--lcd-spiCLI flag for driver selection.Bug Fixes
Tests