Closed
Description
Samd21 classes use an elaborate technique to avoid conditional compiles, based on the C compiler's ability to optimize out globals that aren't used.
- The table of platforms contains all the known platforms.
- The actual class
Catena4450
, etc., has agetPlatformTable()
method that returns the platforms supported by the device. - Startup code calls that as needed.
- Other platforms in the vector aren't referenced, so they're discarded.
STM32 classes instead have a table that's constructed with #if
. This is much more fragile.
Please refactor the Stm32 classes to use the Samd21 technique.