diff --git a/lib/i2cscan/i2cscan.cpp b/lib/i2cscan/i2cscan.cpp index a252caed7..4dde0fca5 100644 --- a/lib/i2cscan/i2cscan.cpp +++ b/lib/i2cscan/i2cscan.cpp @@ -10,6 +10,11 @@ String portMap[] = {"D0", "D1", "D2", "D4", "D5", "D6", "D7"}; uint8_t portArray[] = {2, 3, 4, 5, 6, 7, 8, 9, 10}; uint8_t portExclude[] = {18, 19, 20, 21, LED_PIN}; String portMap[] = {"2", "3", "4", "5", "6", "7", "8", "9", "10"}; +// this is for the ESP32C6 has a lot of pins (10/11 only availiable on the WROOM modules but not on the "mini") +#elif defined(ESP32C6) +uint8_t portArray[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 18, 19, 20, 21, 22, 23}; +String portMap[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "14", "15", "18", "19", "20", "21", "22", "23"}; +uint8_t portExclude[] = {12, 13, 16, 17, LED_PIN}; // exclude USB D+,D- and serial TX/RX #elif defined(ESP32) uint8_t portArray[] = {4, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, 33}; String portMap[] = {"4", "13", "14", "15", "16", "17", "18", "19", "21", "22", "23", "25", "26", "27", "32", "33"}; diff --git a/platformio-tools.ini b/platformio-tools.ini index f77b312b5..8b2d8dac3 100644 --- a/platformio-tools.ini +++ b/platformio-tools.ini @@ -80,6 +80,13 @@ build_flags = -DESP32C3 board = esp32-c3-devkitm-1 +[env:BOARD_ES32C6DEVKITC1] +platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.06.11/platform-espressif32.zip +build_flags = + ${env.build_flags} + -DESP32C6 +board = esp32-c6-devkitc-1 + [env:BOARD_XIAO_ESP32C3] platform = espressif32 @ 6.7.0 platform_packages = diff --git a/platformio.ini b/platformio.ini index 0e90d8028..fb654067f 100644 --- a/platformio.ini +++ b/platformio.ini @@ -109,3 +109,13 @@ upload_speed = 921600 ; ${env.build_flags} ; -DESP32C3 ;board = lolin_c3_mini + +; If you want to use a ESP32C6, you can use this (experimental) +;[env:esp32c6] +;platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.06.11/platform-espressif32.zip +;board = esp32-c6-devkitc-1 +;build_flags = +; ${env.build_flags} +; -DESP32C6 +; -DARDUINO_USB_MODE=1 +; -DARDUINO_USB_CDC_ON_BOOT=1 \ No newline at end of file diff --git a/src/consts.h b/src/consts.h index 04e57698d..4d529d036 100644 --- a/src/consts.h +++ b/src/consts.h @@ -83,8 +83,9 @@ enum class ImuID { #define BOARD_MOCOPI 15 // Used by mocopi/moslime #define BOARD_WEMOSWROOM02 16 #define BOARD_XIAO_ESP32C3 17 -#define BOARD_HARITORA 18 // Used by Haritora/SlimeTora -#define BOARD_DEV_RESERVED 250 // Reserved, should not be used in any release firmware +#define BOARD_HARITORA 18 // Used by Haritora/SlimeTora +#define BOARD_ES32C6DEVKITC1 19 +#define BOARD_DEV_RESERVED 250 // Reserved, should not be used in any release firmware #define BAT_EXTERNAL 1 #define BAT_INTERNAL 2 diff --git a/src/defines.h b/src/defines.h index 34da04b99..3f3ce5f84 100644 --- a/src/defines.h +++ b/src/defines.h @@ -192,7 +192,7 @@ PIN_IMU_SDA, PRIMARY_IMU_OPTIONAL, BMI160_QMC_REMAP) \ #define PIN_BATTERY_LEVEL 3 #define LED_PIN 10 #define LED_INVERTED false -#elif BOARD == BOARD_ES32C3DEVKITM1 +#elif BOARD == BOARD_ES32C3DEVKITM1 || BOARD == BOARD_ES32C6DEVKITC1 #define PIN_IMU_SDA 5 #define PIN_IMU_SCL 4 #define PIN_IMU_INT 6