Skip to content

Commit 3c9546e

Browse files
committed
esp32/mpconfigport: Disable I2CTarget on ESP32-C6 to reduce code size.
I2CTarget costs about 8k of flash size on ESP32-S2, and about 11k on ESP32-C6. The ESP32-C6 only has about 8k remaining, so disable I2CTarget on that SoC until more flash can be made available. Signed-off-by: Damien George <damien@micropython.org>
1 parent e6739fc commit 3c9546e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ports/esp32/mpconfigport.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@
140140
#define MICROPY_PY_MACHINE_I2C (1)
141141
#define MICROPY_PY_MACHINE_I2C_TRANSFER_WRITE1 (1)
142142
// I2C target hardware is limited on ESP32 (eg read event comes after the read) so we only support newer SoCs.
143-
#define MICROPY_PY_MACHINE_I2C_TARGET (SOC_I2C_SUPPORT_SLAVE && !CONFIG_IDF_TARGET_ESP32)
143+
// ESP32C6 does not have enough flash space so also disable it on that SoC.
144+
#define MICROPY_PY_MACHINE_I2C_TARGET (SOC_I2C_SUPPORT_SLAVE && !CONFIG_IDF_TARGET_ESP32 && !CONFIG_IDF_TARGET_ESP32C6)
144145
#define MICROPY_PY_MACHINE_I2C_TARGET_INCLUDEFILE "ports/esp32/machine_i2c_target.c"
145146
#define MICROPY_PY_MACHINE_I2C_TARGET_MAX (2)
146147
#define MICROPY_PY_MACHINE_SOFTI2C (1)

0 commit comments

Comments
 (0)