Repository navigation
Ignore unused HUB75 address pins during ESP32 pin checks - #284
Conversation
Hub75BusOutput::checkPins() previously validated all five address lines (A-E) even when the resolved scan rate only drives A-B (1/4), A-C (1/8), or A-D (1/16), refusing panels on boards where unused upper address lines sit on reserved or input-only pins even though buildPinOrder() parks them at GPIO_NUM_NC. Bound Hub75BusOutput::lines() by hub75AddressBits(geo_.scanRate) during checkPins() while keeping fixedPins() reporting all 14 soldered board lines, and add host unit tests covering 1/4, 1/8, 1/16, and explicit folded 1/4 scans.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
|
Thanks @GK-Triumvirate, a clean fix: the pin check now follows the same hub75AddressBits() as buildPinOrder(), and your MatrixPortal runs per scan back the tests. Nothing blocks. We finish it in a maintainer commit with two small things:
Merging after that. |
…uses The pin check reads the address lines by name rather than by table index, and the MatrixPortal pin test's rig owns the layout and layer its driver points at, so the driver never outlives them. KPI: 256lights | Host:2988KB | tick:8/8/8/8/1/8/268/8/8/8us(FPS:125000/125000/125000/125000/1000000/125000/3731/125000/125000/125000) | ESP32:2474KB | src:523(123969) | test:347(90247) | functions-over:313 Commit: src +5/-3 lines | test +35/-34 lines | duplicated lines 3413 -> 3413 (+0) - **Light domain**: `Hub75BusOutput::lines()` skips the unused address lines by `kFirstAddrLine` and `kAddrLines`, not the indexes 6 and 10. - **Tests**: `MatrixPortalRig` holds layouts, grid, layer and driver together, declared so the driver dies first; the helpers that left the driver pointing at a dead Layer go. - **Docs/CI**: prose and repo-health metrics regenerated. - **Reviews**: the maintainer review's two nits (named range, test lifetime) done; the Reviewer at commit time found nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged, thanks @GK-Triumvirate! It went in together with #285, so main's CI ran once for both. Our maintainer commit named the address-line range (kFirstAddrLine, kAddrLines) instead of the table indexes, and gave the pin test a rig that owns the layout and layer its driver points at. Your MatrixPortal runs per scan made this one easy to trust. |
What it changes, and why
A HUB75 panel uses fewer address lines at a narrower scan: A-B at 1/4, A-C at 1/8, A-D at 1/16.
buildPinOrder()inplatform_esp32_hub75.cppalready follows this: it limits the address lines withhub75AddressBits(scanRate)and parks the rest atGPIO_NUM_NC.Hub75BusOutput::checkPins()checked all five lines (A-E) at every scan rate. An unused upper address line on a reserved or input-only GPIO made it refuse the panel before init.checkPins()now uses the samehub75AddressBits()limit. This covers explicit folded-scan overrides too.fixedPins()still reports all 14 soldered lines on published boards.New unit tests cover 1/4, 1/8, 1/16 and a 16-row panel set to a folded 1/4 scan. The 1/8 and 1/16 cases also check that a bad active pin is refused.
Size
The diff is 2 files, +80/−8:
src/light/drivers/Hub75BusOutput.handtest/unit/light/unit_Hub75Driver_pins.cpp.What agents wrote and audited
b9f1249againstplatform_esp32_hub75.cpp(PASS).b9f1249, and ran the host tests and static checks.Tested
On a Linux host at
b9f1249, based onmainat77481a8:mm_testsmm_testsmm_scenarioscheck_docgen.py, changed filescheck_code.py, changed filesgit diff --checkHardware (tested on Adafruit MatrixPortal S3,
esp32s3-qspi, ESP32-S3 rev v0.2, 8 MB QIO flash, 2 MB quad PSRAM, SDK v6.1.1):/firmware(7.1.0-dev.193, buildb9f1249d) with2× 128×64HUB75 panels stacked vertically (256x64 (2x 128x64), 4-bit (LCD_CAM)at579 Hz).GPIO 26across scan modes onCustom(pre-filled fromMatrixPortal S3):scan = auto(1/32),e = 26: refused withe on GPIO 26 is wired to flash/PSRAM on this chip.scan = 1/16,e = 26: accepted (256x64 (2x 128x64), 1/16 scan, 4-bit (LCD_CAM),579 Hz).scan = 1/16,d = 26: refused withd on GPIO 26 is wired to flash/PSRAM on this chip.scan = 1/8,d = 26: accepted (256x64 (2x 128x64), 1/8 scan, 4-bit (LCD_CAM)).scan = 1/8,c = 26: refused withc on GPIO 26 is wired to flash/PSRAM on this chip.run_gates.py: not yet run. The individual host, docgen and code checks above passed.Follow-up commit:
70b6e0ais acheck_codecleanup (deduplicates the MatrixPortal S3 pin test helpers). CI passes on it: 16 checks passed, 9 skipped.