Skip to content

ChannelManager eagerly initialises every platform channel driver once linked (+~11 KB on Teensy 4.x) #4618

Closed

Description

@zackees

Finding

While measuring #4599 (Teensy 4.x slim bridge, merged as #4617), the teensy41 Blink flash grew from 63,284 B to 84,262 B (+20,978 B). The breakdown:

  • About +11 KB: once ChannelManager is linked, its init path starts every Teensy channel driver (FlexIO, the SPI adapters, and so on), not only the one the sketch uses.
  • 5.2 KB: ChannelManager itself.
  • 6.3 KB: ChannelEngineObjectFLED.
  • 5.0 KB: ObjectFLED.
  • −7.0 KB: the removed legacy proxy.

Why it matters

Ask

  1. Audit each platform's init_channel_driver_* / initChannelDrivers() (Teensy 4.x, RP, SAMD, STM32, nRF52, LPC). Find which drivers get constructed and linked just by ChannelManager being referenced.
  2. Make registration opt-in, matching ESP32: only the bus a BusTraits<Bus::X>::registerWithManager() names gets linked.
  3. Re-measure teensy41 Blink. The refactor(teensy4): legacy clockless onto SlimBridgeController over ChannelEngineObjectFLED (#4588, #4599) #4617 increase should shrink by about 11 KB.

Part of #4580 / #4601.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions