diff --git a/platformio.ini b/platformio.ini index a02dcc29..16dbccb6 100644 --- a/platformio.ini +++ b/platformio.ini @@ -44,4 +44,11 @@ upload_port = /dev/ttyUSB* platform = espressif32@ 6.5.0 board = heltec_wifi_lora_32_V3 board_build.mcu = esp32s3 +framework = arduino + +[env:esp32c3] +platform = espressif32@ 6.5.0 +board = seeed_xiao_esp32c3 +board_build.mcu = esp32c3 +board_build.f_cpu = 160000000L framework = arduino \ No newline at end of file diff --git a/tinyGS/src/ConfigManager/ConfigManager.cpp b/tinyGS/src/ConfigManager/ConfigManager.cpp index 2a8a73d6..ff5e430d 100644 --- a/tinyGS/src/ConfigManager/ConfigManager.cpp +++ b/tinyGS/src/ConfigManager/ConfigManager.cpp @@ -53,6 +53,9 @@ ConfigManager::ConfigManager() #if CONFIG_IDF_TARGET_ESP32S3 { 0x3c, 17, 18, 21, 0, 35, 6, 8, UNUSED, 14, 13, 12, 11, 10, 9, 1.6f, UNUSED, UNUSED, "150–960Mhz - HELTEC LORA32 V3 SX1262" }, // SX1262 { 0x3c, 17, 18, UNUSED, 0, 35, 1, 8, 6, 14, UNUSED, 12, 11, 10, 9, 0.0f, UNUSED, UNUSED, "Custom ESP32-S3 433MHz SX1278" }, // SX1278 @g4lile0 +#elif CONFIG_IDF_TARGET_ESP32C3 + { 0x3c, 0, 1, UNUSED, 20, 21, 6, 8, UNUSED, 3, 4, 5, 6, 7, 10, 1.6f, UNUSED, UNUSED, "433MHz HELTEC LORA32 HT-CT62 SX1262" }, // SX1262 @gargomoma + { 0x3c, 0, 1, UNUSED, 20, 21, 1, 8, 4, UNUSED, UNUSED, 5, 6, 7, 10, 0.0f, UNUSED, UNUSED, "Custom ESP32-C3 433MHz SX1278" }, // SX1278 @gargomoma #else { 0x3c, 4, 15, 16, 0, 25, 1, 18, 26, 12, UNUSED , 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "433MHz HELTEC WiFi LoRA 32 V1" }, // SX1278 @4m1g0 { 0x3c, 4, 15, 16, 0, 25, 2, 18, 26, 12, UNUSED , 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "863-928MHz HELTEC WiFi LoRA 32 V1" }, // SX1276 @@ -568,6 +571,8 @@ void ConfigManager::boardDetection() #if CONFIG_IDF_TARGET_ESP32S3 // nothing yet +#elif CONFIG_IDF_TARGET_ESP32C3 +// nothing yet #else if (strcmp(ESP.getChipModel(), "ESP32-PICO-D4")==0) { itoa(LILYGO_T3_V1_6_1_LF, board, 10); diff --git a/tinyGS/src/ConfigManager/ConfigManager.h b/tinyGS/src/ConfigManager/ConfigManager.h index e6b19d09..9e730907 100644 --- a/tinyGS/src/ConfigManager/ConfigManager.h +++ b/tinyGS/src/ConfigManager/ConfigManager.h @@ -70,6 +70,9 @@ enum boardNum #if CONFIG_IDF_TARGET_ESP32S3 HELTEC_LORA32_V3 = 0, ESP32S3_SX1278_LF, + #elif CONFIG_IDF_TARGET_ESP32C3 + HELTEC_LORA32_HTCT62 = 0, + ESP32C3_SX1278_LF, #else HELTEC_V1_LF = 0, HELTEC_V1_HF, diff --git a/tinyGS/src/ConfigManager/html.h b/tinyGS/src/ConfigManager/html.h index 455b1d9f..14a35876 100644 --- a/tinyGS/src/ConfigManager/html.h +++ b/tinyGS/src/ConfigManager/html.h @@ -29,6 +29,9 @@ const char BOARD_NAMES[][BOARD_NAME_LENGTH] PROGMEM = #if CONFIG_IDF_TARGET_ESP32S3 "433MHz HELTEC LORA32 V3", "Custom ESP32-S3 433MHz SX1278", + #elif CONFIG_IDF_TARGET_ESP32C3 + "433MHz HELTEC LORA32 HT-CT62 SX1262", + "Custom ESP32-C3 433MHz SX1278" , #else "433MHz HELTEC WiFi LoRA 32 V1", "863-928MHz HELTEC WiFi LoRA 32 V1", @@ -58,6 +61,8 @@ constexpr auto BOARD_LENGTH = 3; #if CONFIG_IDF_TARGET_ESP32S3 const char BOARD_VALUES[][BOARD_LENGTH] PROGMEM = {"0", "1" }; +#elif CONFIG_IDF_TARGET_ESP32C3 +const char BOARD_VALUES[][BOARD_LENGTH] PROGMEM = {"0", "1" }; #else const char BOARD_VALUES[][BOARD_LENGTH] PROGMEM = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20" }; #endif diff --git a/tinyGS/src/Radio/Radio.cpp b/tinyGS/src/Radio/Radio.cpp index ae4928a0..674714f9 100644 --- a/tinyGS/src/Radio/Radio.cpp +++ b/tinyGS/src/Radio/Radio.cpp @@ -41,6 +41,8 @@ bool allow_decode=true; Radio::Radio() #if CONFIG_IDF_TARGET_ESP32S3 : spi(HSPI) +#elif CONFIG_IDF_TARGET_ESP32C3 + : spi(SPI) #else : spi(VSPI) #endif diff --git a/tinyGS/tinyGS.ino b/tinyGS/tinyGS.ino index 75c0304a..6485aec3 100644 --- a/tinyGS/tinyGS.ino +++ b/tinyGS/tinyGS.ino @@ -129,7 +129,11 @@ void wifiConnected() void setup() { +#if CONFIG_IDF_TARGET_ESP32C3 + setCpuFrequencyMhz(160); +#else setCpuFrequencyMhz(240); +#endif Serial.begin(115200); delay(100);