From 69cddbca4e66e74fe19e71994360872a6a6a96eb Mon Sep 17 00:00:00 2001 From: recrof Date: Sun, 12 Oct 2025 00:32:26 +0200 Subject: [PATCH] move LilyGoTLoraBoard.h to variants, use template in platformio.ini, cleanup --- .../lilygo_tlora_v2_1}/LilyGoTLoraBoard.h | 4 ++-- variants/lilygo_tlora_v2_1/platformio.ini | 22 ++++--------------- variants/lilygo_tlora_v2_1/target.h | 3 +-- 3 files changed, 7 insertions(+), 22 deletions(-) rename {src/helpers => variants/lilygo_tlora_v2_1}/LilyGoTLoraBoard.h (92%) diff --git a/src/helpers/LilyGoTLoraBoard.h b/variants/lilygo_tlora_v2_1/LilyGoTLoraBoard.h similarity index 92% rename from src/helpers/LilyGoTLoraBoard.h rename to variants/lilygo_tlora_v2_1/LilyGoTLoraBoard.h index c595740f..545219b2 100644 --- a/src/helpers/LilyGoTLoraBoard.h +++ b/variants/lilygo_tlora_v2_1/LilyGoTLoraBoard.h @@ -1,7 +1,7 @@ #pragma once #include -#include "ESP32Board.h" +#include // LILYGO T-LoRa V2.1-1.6 board with SX1276 class LilyGoTLoraBoard : public ESP32Board { @@ -9,7 +9,7 @@ public: const char* getManufacturerName() const override { return "LILYGO T-LoRa V2.1-1.6"; } - + uint16_t getBattMilliVolts() override { analogReadResolution(12); diff --git a/variants/lilygo_tlora_v2_1/platformio.ini b/variants/lilygo_tlora_v2_1/platformio.ini index e580959c..9ef9734e 100644 --- a/variants/lilygo_tlora_v2_1/platformio.ini +++ b/variants/lilygo_tlora_v2_1/platformio.ini @@ -6,6 +6,8 @@ build_type = release ; Set build type to release board_build.partitions = min_spiffs.csv ; get around 4mb flash limit build_flags = ${esp32_base.build_flags} + ${sensor_base.build_flags} + -UENV_INCLUDE_GPS -I variants/lilygo_tlora_v2_1 -Os -ffunction-sections -fdata-sections ; Optimize for size -D LILYGO_TLORA ; LILYGO T-LoRa V2.1-1.6 ESP32 with SX1276 @@ -27,28 +29,18 @@ build_flags = -D WRAPPER_CLASS=CustomSX1276Wrapper -D SX127X_CURRENT_LIMIT=120 -D LORA_TX_POWER=20 - -D ENV_INCLUDE_AHTX0=1 - -D ENV_INCLUDE_BME280=1 - -D ENV_INCLUDE_BMP280=1 - -D ENV_INCLUDE_INA3221=1 - -D ENV_INCLUDE_INA219=1 build_src_filter = ${esp32_base.build_src_filter} + + +<../variants/lilygo_tlora_v2_1> + lib_deps = ${esp32_base.lib_deps} - adafruit/Adafruit SSD1306 @ ^2.5.13 - adafruit/Adafruit INA3221 Library @ ^1.0.1 - adafruit/Adafruit INA219 @ ^1.2.3 - adafruit/Adafruit AHTX0 @ ^2.0.5 - adafruit/Adafruit BME280 Library @ ^2.3.0 - adafruit/Adafruit BMP280 Library @ ^2.6.8 + ${sensor_base.lib_deps} ; === LILYGO T-LoRa V2.1-1.6 with SX1276 environments === [env:LilyGo_TLora_V2_1_1_6_repeater] extends = LilyGo_TLora_V2_1_1_6 build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} - + +<../examples/simple_repeater> build_flags = ${LilyGo_TLora_V2_1_1_6.build_flags} @@ -73,7 +65,6 @@ build_flags = ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} - + +<../examples/simple_repeater> lib_deps = ${LilyGo_TLora_V2_1_1_6.lib_deps} @@ -89,7 +80,6 @@ build_flags = ; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1 ; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1 build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} - + + +<../examples/companion_radio/*.cpp> +<../examples/companion_radio/ui-new/*.cpp> @@ -111,7 +101,6 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} + - + + +<../examples/companion_radio/*.cpp> +<../examples/companion_radio/ui-new/*.cpp> @@ -149,7 +138,6 @@ build_flags = -D WIFI_DEBUG_LOGGING=1 build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} + - + + +<../examples/companion_radio/*.cpp> +<../examples/companion_radio/ui-new/*.cpp> @@ -163,7 +151,6 @@ lib_deps = [env:LilyGo_TLora_V2_1_1_6_repeater_bridge_rs232] extends = LilyGo_TLora_V2_1_1_6 build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} - + + +<../examples/simple_repeater> build_flags = @@ -187,7 +174,6 @@ lib_deps = [env:LilyGo_TLora_V2_1_1_6_repeater_bridge_espnow] extends = LilyGo_TLora_V2_1_1_6 build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} - + + +<../examples/simple_repeater> build_flags = diff --git a/variants/lilygo_tlora_v2_1/target.h b/variants/lilygo_tlora_v2_1/target.h index 380d733b..326a0dee 100644 --- a/variants/lilygo_tlora_v2_1/target.h +++ b/variants/lilygo_tlora_v2_1/target.h @@ -3,10 +3,9 @@ #define RADIOLIB_STATIC_ONLY 1 #include #include -#include +#include #include #include -#include #include #ifdef DISPLAY_CLASS #include