diff --git a/src/lgfx/v1/platforms/esp32/common.cpp b/src/lgfx/v1/platforms/esp32/common.cpp index fb472a62..38cc2bc8 100644 --- a/src/lgfx/v1/platforms/esp32/common.cpp +++ b/src/lgfx/v1/platforms/esp32/common.cpp @@ -690,7 +690,11 @@ namespace lgfx static periph_module_t getPeriphModule(int num) { +#if SOC_I2C_NUM == 1 || defined CONFIG_IDF_TARGET_ESP32C6 + return &PERIPH_I2C0_MODULE; +#else return num == 0 ? PERIPH_I2C0_MODULE : PERIPH_I2C1_MODULE; +#endif } static i2c_dev_t* getDev(int num)