summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2025-08-02 08:52:05 +1000
committerDamien George <damien@micropython.org>2025-08-02 08:53:36 +1000
commit3c9546ea0911b50d4b85ad4046864c90f84b3fd3 (patch)
tree0c07e395f0edc6919f7263e4b8a418ed72a1a26d
parente6739fc87e9d633484aeb72fa2efac14e4ff7681 (diff)
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>
-rw-r--r--ports/esp32/mpconfigport.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/ports/esp32/mpconfigport.h b/ports/esp32/mpconfigport.h
index 48ad39ef7..cc10fd0b7 100644
--- a/ports/esp32/mpconfigport.h
+++ b/ports/esp32/mpconfigport.h
@@ -140,7 +140,8 @@
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_I2C_TRANSFER_WRITE1 (1)
// I2C target hardware is limited on ESP32 (eg read event comes after the read) so we only support newer SoCs.
-#define MICROPY_PY_MACHINE_I2C_TARGET (SOC_I2C_SUPPORT_SLAVE && !CONFIG_IDF_TARGET_ESP32)
+// ESP32C6 does not have enough flash space so also disable it on that SoC.
+#define MICROPY_PY_MACHINE_I2C_TARGET (SOC_I2C_SUPPORT_SLAVE && !CONFIG_IDF_TARGET_ESP32 && !CONFIG_IDF_TARGET_ESP32C6)
#define MICROPY_PY_MACHINE_I2C_TARGET_INCLUDEFILE "ports/esp32/machine_i2c_target.c"
#define MICROPY_PY_MACHINE_I2C_TARGET_MAX (2)
#define MICROPY_PY_MACHINE_SOFTI2C (1)