-
- Downloads
stm32: Allow to build a board without any hardware I2C ports defined.
This patch adds in internal config value MICROPY_HW_ENABLE_HW_I2C that is automatically configured, and enabled only if one or more hardware I2C ports are defined in the mpconfigboard.h file. If none are defined then the pyb.I2C class is excluded from the build, along with all supporting code. The machine.I2C class will still be available for software I2C. Disabling all hardware I2C on an F4 board saves around 10,000 bytes of code and 200 bytes of RAM.
Showing
- ports/stm32/i2c.c 4 additions, 0 deletionsports/stm32/i2c.c
- ports/stm32/machine_i2c.c 4 additions, 0 deletionsports/stm32/machine_i2c.c
- ports/stm32/main.c 3 additions, 0 deletionsports/stm32/main.c
- ports/stm32/modpyb.c 2 additions, 0 deletionsports/stm32/modpyb.c
- ports/stm32/mpconfigport.h 11 additions, 1 deletionports/stm32/mpconfigport.h
Please register or sign in to comment