From 31decd5a04586207de7c84443bee4a2e20884082 Mon Sep 17 00:00:00 2001 From: richonguzman Date: Fri, 2 Aug 2024 11:48:13 -0400 Subject: [PATCH] esp32s3 diy added --- platformio.ini | 33 +++++++++++++++++++++++++++++++++ src/boards_pinout.h | 2 +- src/power_utils.cpp | 2 +- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index ccf4716..3b4f12a 100644 --- a/platformio.ini +++ b/platformio.ini @@ -390,6 +390,39 @@ lib_deps = adafruit/Adafruit SH110X @ 2.1.10 +[env:ESP32S3_DIY_LoRa_GPS] +extends = env:esp32 +board = esp32-s3-devkitc-1 +board_build.mcu = esp32s3 +build_flags = + -Werror -Wall + -DESP32S3_DIY_LoRa_GPS + -DHAS_SX1278 + -DARDUINO_USB_MODE=1 + -DARDUINO_USB_CDC_ON_BOOT=1 +lib_deps = + ${common.lib_deps} + adafruit/Adafruit GFX Library @ 1.11.9 + adafruit/Adafruit SSD1306 @ 2.5.10 + adafruit/Adafruit SH110X @ 2.1.10 + +[env:ESP32S3_DIY_LoRa_GPS_915] +extends = env:esp32 +board = esp32-s3-devkitc-1 +board_build.mcu = esp32s3 +build_flags = + -Werror -Wall + -DESP32S3_DIY_LoRa_GPS_915 + -DHAS_SX1276 + -DARDUINO_USB_MODE=1 + -DARDUINO_USB_CDC_ON_BOOT=1 +lib_deps = + ${common.lib_deps} + adafruit/Adafruit GFX Library @ 1.11.9 + adafruit/Adafruit SSD1306 @ 2.5.10 + adafruit/Adafruit SH110X @ 2.1.10 + + [env:ESP32_DIY_1W_LoRa_GPS] extends = env:esp32 board = esp32dev diff --git a/src/boards_pinout.h b/src/boards_pinout.h index 15ca85f..8176f75 100644 --- a/src/boards_pinout.h +++ b/src/boards_pinout.h @@ -57,7 +57,7 @@ #endif -#if defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_GPS_915) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_LORA32_V2_1_TNC_915) || defined(ESP32_DIY_LoRa_GPS) || defined(ESP32_DIY_LoRa_GPS_915) +#if defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_GPS_915) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_LORA32_V2_1_TNC_915) || defined(ESP32_DIY_LoRa_GPS) || defined(ESP32_DIY_LoRa_GPS_915) || defined(ESP32S3_DIY_LoRa_GPS) || defined(ESP32S3_DIY_LoRa_GPS_915) #define OLED_SDA 21 #define OLED_SCL 22 #define OLED_RST 16 diff --git a/src/power_utils.cpp b/src/power_utils.cpp index 7e8e61e..3d20c32 100644 --- a/src/power_utils.cpp +++ b/src/power_utils.cpp @@ -74,7 +74,7 @@ namespace POWER_Utils { batteryMeasurmentTime = millis(); #endif double voltage = (adc_value * 3.3 ) / 4095.0; - #if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_GPS_915) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_LORA32_V2_1_TNC_915) || defined(ESP32_DIY_LoRa_GPS) || defined(ESP32_DIY_LoRa_GPS_915) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(ESP32_DIY_1W_LoRa_GPS_915) || defined(OE5HWN_MeshCom) || defined(TTGO_T_DECK_GPS) + #if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_GPS_915) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_LORA32_V2_1_TNC_915) || defined(ESP32_DIY_LoRa_GPS) || defined(ESP32_DIY_LoRa_GPS_915) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(ESP32_DIY_1W_LoRa_GPS_915) || defined(OE5HWN_MeshCom) || defined(TTGO_T_DECK_GPS) || defined(ESP32S3_DIY_LoRa_GPS) || defined(ESP32S3_DIY_LoRa_GPS_915) return (2 * (voltage + 0.1)) * (1 + (lora32BatReadingCorr/100)); // (2 x 100k voltage divider) 2 x voltage divider/+0.1 because ESP32 nonlinearity ~100mV ADC offset/extra correction #endif #if defined(HELTEC_V3_GPS) || defined(HELTEC_V3_TNC)|| defined(HELTEC_WIRELESS_TRACKER) || defined(ESP32_C3_DIY_LoRa_GPS) || defined(ESP32_C3_DIY_LoRa_GPS_915) || defined(WEMOS_ESP32_Bat_LoRa_GPS)