diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index 34ba60e5..0f540878 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -202,8 +202,8 @@ public: display.print(tmp); } else if (_page == HomePage::BLUETOOTH) { display.setColor(DisplayDriver::GREEN); - display.drawXbm((display.width() - 32) / 2, 18, - _task->isSerialEnabled() ? bluetooth_on : bluetooth_off, + display.drawXbm((display.width() - 32) / 2, 18, + _task->isSerialEnabled() ? bluetooth_on : bluetooth_off, 32, 32); display.setTextSize(1); display.drawTextCentered(display.width() / 2, 64 - 11, "toggle: " PRESS_LABEL); @@ -455,8 +455,8 @@ void UITask::setCurrScreen(UIScreen* c) { _next_refresh = 100; } -/* - hardware-agnostic pre-shutdown activity should be done here +/* + hardware-agnostic pre-shutdown activity should be done here */ void UITask::shutdown(bool restart){ @@ -584,7 +584,7 @@ void UITask::loop() { // show low battery shutdown alert // we should only do this for eink displays, which will persist after power loss - #ifdef THINKNODE_M1 + #if defined(THINKNODE_M1) || defined(LILYGO_TECHO) if (_display != NULL) { _display->startFrame(); _display->setTextSize(2); diff --git a/src/helpers/nrf52/TechoBoard.cpp b/variants/lilygo_techo/TechoBoard.cpp similarity index 100% rename from src/helpers/nrf52/TechoBoard.cpp rename to variants/lilygo_techo/TechoBoard.cpp diff --git a/src/helpers/nrf52/TechoBoard.h b/variants/lilygo_techo/TechoBoard.h similarity index 78% rename from src/helpers/nrf52/TechoBoard.h rename to variants/lilygo_techo/TechoBoard.h index 2c05c4ed..4792153a 100644 --- a/src/helpers/nrf52/TechoBoard.h +++ b/variants/lilygo_techo/TechoBoard.h @@ -3,19 +3,6 @@ #include #include -// LoRa radio module pins for LilyGo T-Echo -#define P_LORA_DIO_1 20 -#define P_LORA_NSS 24 -#define P_LORA_RESET 25 -#define P_LORA_BUSY 17 -#define P_LORA_SCLK 19 -#define P_LORA_MISO 23 -#define P_LORA_MOSI 22 -#define SX126X_POWER_EN 37 - -#define SX126X_DIO2_AS_RF_SWITCH true -#define SX126X_DIO3_TCXO_VOLTAGE 1.8 - // built-ins #define VBAT_MV_PER_LSB (0.73242188F) // 3.0V ADC range and 12-bit ADC resolution = 3000mV/4096 diff --git a/variants/techo/platformio.ini b/variants/lilygo_techo/platformio.ini similarity index 59% rename from variants/techo/platformio.ini rename to variants/lilygo_techo/platformio.ini index 812baa78..8a090a4d 100644 --- a/variants/techo/platformio.ini +++ b/variants/lilygo_techo/platformio.ini @@ -1,24 +1,26 @@ -[nrf52840_techo] +[LilyGo_T-Echo] extends = nrf52_base -platform_packages = framework-arduinoadafruitnrf52 +board = t-echo +board_build.ldscript = boards/nrf52840_s140_v6.ld build_flags = ${nrf52_base.build_flags} + -I variants/lilygo_techo -I src/helpers/nrf52 -I lib/nrf52/s140_nrf52_6.1.1_API/include -I lib/nrf52/s140_nrf52_6.1.1_API/include/nrf52 -lib_deps = - ${nrf52_base.lib_deps} - rweather/Crypto @ ^0.4.0 - -[LilyGo_Techo] -extends = nrf52840_techo -board = t-echo -board_build.ldscript = boards/nrf52840_s140_v6.ld -build_flags = ${nrf52840_techo.build_flags} - -I variants/techo - -DLILYGO_TECHO + -D LILYGO_TECHO -D RADIO_CLASS=CustomSX1262 -D WRAPPER_CLASS=CustomSX1262Wrapper -D LORA_TX_POWER=22 + -D P_LORA_DIO_1=20 + -D P_LORA_NSS=24 + -D P_LORA_RESET=25 + -D P_LORA_BUSY=17 + -D P_LORA_SCLK=19 + -D P_LORA_MISO=23 + -D P_LORA_MOSI=22 + -D SX126X_POWER_EN=37 + -D SX126X_DIO2_AS_RF_SWITCH=true + -D SX126X_DIO3_TCXO_VOLTAGE=1.8 -D SX126X_CURRENT_LIMIT=140 -D SX126X_RX_BOOSTED_GAIN=1 -D P_LORA_TX_LED=LED_GREEN @@ -28,23 +30,31 @@ build_flags = ${nrf52840_techo.build_flags} -D GPS_BAUD_RATE=9600 -D PIN_GPS_EN=GPS_EN -D TELEM_BME280_ADDRESS=0x77 -build_src_filter = ${nrf52840_techo.build_src_filter} + -D DISPLAY_CLASS=GxEPDDisplay + -D BACKLIGHT_BTN=PIN_BUTTON2 + -D AUTO_OFF_MILLIS=0 +build_src_filter = ${nrf52_base.build_src_filter} + - + + + + - +<../variants/techo> + + + + + +<../variants/lilygo_techo> lib_deps = - ${nrf52840_techo.lib_deps} + ${nrf52_base.lib_deps} stevemarple/MicroNMEA @ ^2.0.6 adafruit/Adafruit BME280 Library @ ^2.3.0 + zinggjm/GxEPD2 @ 1.6.2 + bakercp/CRC32 @ ^2.0.0 debug_tool = jlink upload_protocol = nrfutil [env:LilyGo_T-Echo_repeater] -extends = LilyGo_Techo -build_src_filter = ${LilyGo_Techo.build_src_filter} +<../examples/simple_repeater/main.cpp> +extends = LilyGo_T-Echo +build_src_filter = ${LilyGo_T-Echo.build_src_filter} + +<../examples/simple_repeater> build_flags = - ${LilyGo_Techo.build_flags} + ${LilyGo_T-Echo.build_flags} -D ADVERT_NAME='"T-Echo Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -54,10 +64,11 @@ build_flags = ; -D MESH_DEBUG=1 [env:LilyGo_T-Echo_room_server] -extends = LilyGo_Techo -build_src_filter = ${LilyGo_Techo.build_src_filter} +<../examples/simple_room_server/main.cpp> +extends = LilyGo_T-Echo +build_src_filter = ${LilyGo_T-Echo.build_src_filter} + +<../examples/simple_room_server> build_flags = - ${LilyGo_Techo.build_flags} + ${LilyGo_T-Echo.build_flags} -D ADVERT_NAME='"T-Echo Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -66,31 +77,41 @@ build_flags = ; -D MESH_DEBUG=1 [env:LilyGo_T-Echo_companion_radio_ble] -extends = LilyGo_Techo +extends = LilyGo_T-Echo build_flags = - ${LilyGo_Techo.build_flags} + ${LilyGo_T-Echo.build_flags} -I src/helpers/ui -I examples/companion_radio/ui-new -D MAX_CONTACTS=100 -D MAX_GROUP_CHANNELS=8 -D BLE_PIN_CODE=123456 ; -D BLE_DEBUG_LOGGING=1 - -D DISPLAY_CLASS=GxEPDDisplay -D OFFLINE_QUEUE_SIZE=256 - -D UI_RECENT_LIST_SIZE=9 - -D BACKLIGHT_BTN=PIN_BUTTON2 - -D AUTO_OFF_MILLIS=0 ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 -build_src_filter = ${LilyGo_Techo.build_src_filter} - + + -D AUTO_SHUTDOWN_MILLIVOLTS=3300 +build_src_filter = ${LilyGo_T-Echo.build_src_filter} + - + - + +<../examples/companion_radio/*.cpp> +<../examples/companion_radio/ui-new/*.cpp> lib_deps = - ${LilyGo_Techo.lib_deps} + ${LilyGo_T-Echo.lib_deps} + densaugeo/base64 @ ~1.4.0 + +[env:LilyGo_T-Echo_companion_radio_usb] +extends = LilyGo_T-Echo +build_flags = + ${LilyGo_T-Echo.build_flags} + -I src/helpers/ui + -I examples/companion_radio/ui-new + -D MAX_CONTACTS=100 + -D MAX_GROUP_CHANNELS=8 + -D OFFLINE_QUEUE_SIZE=256 + -D UI_RECENT_LIST_SIZE=9 + -D AUTO_SHUTDOWN_MILLIVOLTS=3300 +build_src_filter = ${LilyGo_T-Echo.build_src_filter} + +<../examples/companion_radio/*.cpp> + +<../examples/companion_radio/ui-new/*.cpp> +lib_deps = + ${LilyGo_T-Echo.lib_deps} densaugeo/base64 @ ~1.4.0 - zinggjm/GxEPD2 @ 1.6.2 - bakercp/CRC32 @ ^2.0.0 diff --git a/variants/techo/target.cpp b/variants/lilygo_techo/target.cpp similarity index 100% rename from variants/techo/target.cpp rename to variants/lilygo_techo/target.cpp diff --git a/variants/techo/target.h b/variants/lilygo_techo/target.h similarity index 95% rename from variants/techo/target.h rename to variants/lilygo_techo/target.h index 134f13b5..2b6ed45f 100644 --- a/variants/techo/target.h +++ b/variants/lilygo_techo/target.h @@ -3,7 +3,7 @@ #define RADIOLIB_STATIC_ONLY 1 #include #include -#include +#include #include #include #include diff --git a/variants/techo/variant.cpp b/variants/lilygo_techo/variant.cpp similarity index 100% rename from variants/techo/variant.cpp rename to variants/lilygo_techo/variant.cpp diff --git a/variants/techo/variant.h b/variants/lilygo_techo/variant.h similarity index 100% rename from variants/techo/variant.h rename to variants/lilygo_techo/variant.h