Skip to content

perf(esp32dev): APA102 still links the I2S clockless peripheral (~2.2 KB flash, 272 B RAM) after #4793 #4809

Closed

Description

@zackees

Found while doing #4793 (part of #4801).

After #4793, an APA102 sketch on esp32dev no longer links the wave8 clockless pipeline. It still links the I2S clockless peripheral, because createI2sEsp32DevEngine() constructs I2sPeripheralEsp32DevEsp eagerly for both I2S ports:

symbol bytes
I2sPeripheralEsp32DevEsp::initialize 1,040
I2sPeripheralEsp32DevEsp::transmit 464
ChannelEngineI2sEsp32Dev::poll 374
I2sPeripheralEsp32DevEsp::deinitialize / routeLanePin / waitTransmitDone ~320
Singleton<I2sPeripheralEsp32DevEsp, 0/1>::storage 2 × 136 B RAM

SPI batches go to the separate createI2sSpiEngine() delegate, so in an SPI-only program this peripheral is never initialized.

Proposed fix

Create the clockless peripheral lazily inside the enabled clockless path (showClocklessBatch), or through a factory that BusTraits<FLEX_IO>::enableClockless() installs, so SPI-only programs never name it.

Acceptance

  • esp32dev APA102 drops about 2.2 KB flash and about 272 B RAM.
  • setExclusiveDriver<Bus::FLEX_IO> clockless sketches are unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform: esp32priority: mediumtype: regression

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions