Skip to content

Commit

Permalink
first library cleaning in platformio
Browse files Browse the repository at this point in the history
  • Loading branch information
richonguzman committed Apr 23, 2024
1 parent f2a6bbf commit eb472b1
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 28 deletions.
82 changes: 57 additions & 25 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,155 +21,187 @@ board_build.embed_files =
data_embed/script.js.gz
data_embed/bootstrap.css.gz
data_embed/bootstrap.js.gz
lib_deps =
bblanchon/ArduinoJson@^6.20.2
extra_scripts =
pre:tools/compress.py
debug_tool = esp-prog


[common]
lib_deps =
bblanchon/ArduinoJson @ 6.21.3
mikalhart/TinyGPSPlus @ 1.0.3
jgromes/RadioLib @ 6.1.0
adafruit/Adafruit GFX Library @ 1.11.5
adafruit/Adafruit SSD1306 @ 2.5.7
mikalhart/TinyGPSPlus @ 1.0.3
adafruit/Adafruit Unified Sensor@^1.1.9
adafruit/Adafruit BME280 Library@^2.2.2
adafruit/Adafruit BMP280 Library@^2.6.8
adafruit/Adafruit BME680 Library@^2.0.4
jgromes/RadioLib @ 6.1.0
lewisxhe/XPowersLib@^0.1.8
ayushsharma82/ElegantOTA@^3.1.0
ottowinter/[email protected]
esphome/[email protected]

extra_scripts =
pre:tools/compress.py

debug_tool = esp-prog

[env:ttgo-lora32-v21]
board = ttgo-lora32-v21
build_flags =
-Werror -Wall
-DTTGO_T_LORA32_V2_1
-DHAS_SX127X
-DHAS_SX1278
-DELEGANTOTA_USE_ASYNC_WEBSERVER=1
lib_deps =
${common.lib_deps}


[env:heltec-lora32-v2]
board = ttgo-lora32-v21
build_flags =
-Werror -Wall
-DHELTEC_V2
-DHAS_SX127X
-DHAS_SX1278
-DELEGANTOTA_USE_ASYNC_WEBSERVER=1
lib_deps =
${common.lib_deps}


[env:heltec_wifi_lora_32_V3]
board = heltec_wifi_lora_32_V3
board_build.mcu = esp32s3
build_flags =
-Werror -Wall
-DHELTEC_V3
-DHAS_SX126X
-DHAS_SX1262
-DELEGANTOTA_USE_ASYNC_WEBSERVER=1
lib_deps =
${common.lib_deps}


[env:ESP32_DIY_LoRa]
board = esp32dev
build_flags =
-Werror -Wall
-DESP32_DIY_LoRa
-DHAS_SX127X
-DHAS_SX1278
-DELEGANTOTA_USE_ASYNC_WEBSERVER=1
lib_deps =
${common.lib_deps}


[env:ESP32_DIY_1W_LoRa]
board = esp32dev
build_flags =
-Werror -Wall
-DESP32_DIY_1W_LoRa
-DHAS_SX126X
-DHAS_SX1268
-DELEGANTOTA_USE_ASYNC_WEBSERVER=1
lib_deps =
${common.lib_deps}


[env:ttgo-t-beam-v1_2]
board = ttgo-t-beam
build_flags =
-Werror -Wall
-DTTGO_T_Beam_V1_2
-DHAS_SX127X
-DHAS_SX1278
-DHAS_AXP2101
-DELEGANTOTA_USE_ASYNC_WEBSERVER=1
lib_deps =
${common.lib_deps}
lewisxhe/XPowersLib@^0.1.8


[env:ttgo-t-beam-v1]
board = ttgo-t-beam
build_flags =
-Werror -Wall
-DTTGO_T_Beam_V1_0
-DHAS_SX127X
-DHAS_SX1278
-DHAS_AXP192
-DELEGANTOTA_USE_ASYNC_WEBSERVER=1
lib_deps =
${common.lib_deps}
lewisxhe/XPowersLib@^0.1.8


[env:ttgo-t-beam-v1_SX1268]
board = ttgo-t-beam
build_flags =
-Werror -Wall
-DTTGO_T_Beam_V1_0_SX1268
-DHAS_SX126X
-DHAS_SX1268
-DHAS_AXP192
-DELEGANTOTA_USE_ASYNC_WEBSERVER=1
lib_deps =
${common.lib_deps}
lewisxhe/XPowersLib@^0.1.8


[env:ttgo-t-beam-v1_2_SX1262]
board = ttgo-t-beam
build_flags =
-Werror -Wall
-DTTGO_T_Beam_V1_2_SX1262
-DHAS_SX126X
-DHAS_SX1262
-DHAS_AXP2101
-DELEGANTOTA_USE_ASYNC_WEBSERVER=1
lib_deps =
${common.lib_deps}
lewisxhe/XPowersLib@^0.1.8


[env:OE5HWN_MeshCom]
board = esp32dev
build_flags =
-Werror -Wall
-DOE5HWN_MeshCom
-DHAS_SX126X
-DHAS_SX1268
-DELEGANTOTA_USE_ASYNC_WEBSERVER=1
lib_deps =
${common.lib_deps}


[env:heltec_wireless_stick]
board = heltec_wifi_lora_32_V3
board_build.mcu = esp32s3
build_flags =
-Werror -Wall
-DHELTEC_WS
-DHAS_SX126X
-DHAS_SX1262
-DELEGANTOTA_USE_ASYNC_WEBSERVER=1
lib_deps =
${common.lib_deps}


[env:heltec_ht-ct62]
board = heltec_wireless_stick_lite
board_build.mcu = esp32c3
build_flags =
-Werror -Wall
-DHELTEC_HTCT62
-DHAS_SX126X
-DHAS_SX1262
-DELEGANTOTA_USE_ASYNC_WEBSERVER=1
lib_deps =
${common.lib_deps}


[env:WEMOS-LOLIN32-OLED-DIY]
board = lolin32
build_flags =
-Werror -Wall
-DWEMOS_LOLIN32_OLED_DIY_LoRa
-DHAS_SX127X
-DHAS_SX1278
-DELEGANTOTA_USE_ASYNC_WEBSERVER=1
lib_deps =
${common.lib_deps}


[env:ESP32_DIY_LoRa_A7670]
board = esp32dev
build_flags =
-Werror -Wall
-DESP32_DIY_LoRa_A7670
-DHAS_SX127X
-DESP32_DIY_LoRa_A7670
-DHAS_SX1278
-DELEGANTOTA_USE_ASYNC_WEBSERVER=1
-DELEGANTOTA_USE_ASYNC_WEBSERVER=1
lib_deps =
${common.lib_deps}
6 changes: 3 additions & 3 deletions src/lora_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ namespace LoRa_Utils {
Utils::println("Starting LoRa failed!");
while (true);
}
#ifdef HAS_SX127X
#ifdef HAS_SX1278
radio.setDio0Action(setFlag, RISING);
#endif
#ifdef HAS_SX126X
#if defined(HAS_SX1262) || defined(HAS_SX1268)
if (!Config.lowPowerMode) {
radio.setDio1Action(setFlag);
} else {
Expand All @@ -68,7 +68,7 @@ namespace LoRa_Utils {
radio.setRfSwitchPins(RADIO_RXEN, RADIO_TXEN);
#endif

#if defined(HAS_SX127X) || ESP32_DIY_1W_LoRa
#if defined(HAS_SX1278) || ESP32_DIY_1W_LoRa
state = radio.setOutputPower(Config.loramodule.power); // max value 20dB for 400M30S as it has Low Noise Amp
#endif
#if defined(HELTEC_V3) || defined(HELTEC_WS) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2_SX1262)
Expand Down
4 changes: 4 additions & 0 deletions src/power_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
#define POWER_UTILS_H_

#include <Arduino.h>
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
#include "XPowersLib.h"
#else
#include <Wire.h>
#endif


namespace POWER_Utils {
Expand Down

0 comments on commit eb472b1

Please sign in to comment.