Skip to content

Commit f5c7d3d

Browse files
authored
Merge branch 'dev' into esp32_c3_c6_s3_max_contacts_300
2 parents 50cab44 + 8a39e80 commit f5c7d3d

File tree

6 files changed

+40
-4
lines changed

6 files changed

+40
-4
lines changed

examples/companion_radio/ui-new/UITask.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,22 @@ void UITask::loop() {
551551
if (millis() > next_batt_chck) {
552552
uint16_t milliVolts = getBattMilliVolts();
553553
if (milliVolts > 0 && milliVolts < AUTO_SHUTDOWN_MILLIVOLTS) {
554+
555+
// show low battery shutdown alert
556+
// we should only do this for eink displays, which will persist after power loss
557+
#ifdef THINKNODE_M1
558+
if (_display != NULL) {
559+
_display->startFrame();
560+
_display->setTextSize(2);
561+
_display->setColor(DisplayDriver::RED);
562+
_display->drawTextCentered(_display->width() / 2, 20, "Low Battery.");
563+
_display->drawTextCentered(_display->width() / 2, 40, "Shutting Down!");
564+
_display->endFrame();
565+
}
566+
#endif
567+
554568
shutdown();
569+
555570
}
556571
next_batt_chck = millis() + 8000;
557572
}

src/helpers/nrf52/ThinkNodeM1Board.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ class ThinkNodeM1Board : public mesh::MainBoard {
5757
}
5858

5959
void powerOff() override {
60+
61+
// turn off all leds, sd_power_system_off will not do this for us
62+
#ifdef P_LORA_TX_LED
63+
digitalWrite(P_LORA_TX_LED, LOW);
64+
#endif
65+
66+
// power off board
6067
sd_power_system_off();
68+
6169
}
6270
};

variants/meshadventurer/platformio.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ build_src_filter = ${Meshadventurer.build_src_filter}
8282
+<helpers/ui/SSD1306Display.cpp>
8383
build_flags =
8484
${Meshadventurer.build_flags}
85+
-I examples/companion_radio/ui-new
8586
-D RADIO_CLASS=CustomSX1262
8687
-D WRAPPER_CLASS=CustomSX1262Wrapper
8788
-D LORA_TX_POWER=22
@@ -99,8 +100,11 @@ build_src_filter = ${Meshadventurer.build_src_filter}
99100
+<../examples/companion_radio/*.cpp>
100101
+<helpers/esp32/*.cpp>
101102
+<helpers/ui/SSD1306Display.cpp>
103+
+<../examples/companion_radio/*.cpp>
104+
+<../examples/companion_radio/ui-new/*.cpp>
102105
build_flags =
103106
${Meshadventurer.build_flags}
107+
-I examples/companion_radio/ui-new
104108
-D RADIO_CLASS=CustomSX1262
105109
-D WRAPPER_CLASS=CustomSX1262Wrapper
106110
-D LORA_TX_POWER=22
@@ -159,8 +163,11 @@ extends = Meshadventurer
159163
build_src_filter = ${Meshadventurer.build_src_filter}
160164
+<../examples/companion_radio/*.cpp>
161165
+<helpers/ui/SSD1306Display.cpp>
166+
+<../examples/companion_radio/*.cpp>
167+
+<../examples/companion_radio/ui-new/*.cpp>
162168
build_flags =
163169
${Meshadventurer.build_flags}
170+
-I examples/companion_radio/ui-new
164171
-D RADIO_CLASS=CustomSX1268
165172
-D WRAPPER_CLASS=CustomSX1268Wrapper
166173
-D LORA_TX_POWER=22
@@ -178,8 +185,11 @@ build_src_filter = ${Meshadventurer.build_src_filter}
178185
+<../examples/companion_radio/*.cpp>
179186
+<helpers/esp32/*.cpp>
180187
+<helpers/ui/SSD1306Display.cpp>
188+
+<../examples/companion_radio/*.cpp>
189+
+<../examples/companion_radio/ui-new/*.cpp>
181190
build_flags =
182191
${Meshadventurer.build_flags}
192+
-I examples/companion_radio/ui-new
183193
-D RADIO_CLASS=CustomSX1268
184194
-D WRAPPER_CLASS=CustomSX1268Wrapper
185195
-D LORA_TX_POWER=22

variants/meshadventurer/target.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ MASensorManager sensors = MASensorManager(nmea);
1818
DISPLAY_CLASS display;
1919
#endif
2020

21-
#ifndef LORA_CR
22-
#define LORA_CR 5
23-
#endif
24-
2521
bool radio_init() {
2622
fallback_clock.begin();
2723
rtc_clock.begin(Wire);

variants/thinknode_m1/platformio.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ build_flags =
7777
-D DISPLAY_CLASS=GxEPDDisplay
7878
-D OFFLINE_QUEUE_SIZE=256
7979
-D PIN_BUZZER=6
80+
-D AUTO_SHUTDOWN_MILLIVOLTS=3300
8081
; -D MESH_PACKET_LOGGING=1
8182
; -D MESH_DEBUG=1
8283
build_src_filter = ${ThinkNode_M1.build_src_filter}

variants/xiao_s3_wio/platformio.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,21 @@ lib_deps =
103103
extends = Xiao_S3_WIO
104104
build_flags =
105105
${Xiao_S3_WIO.build_flags}
106+
-I examples/companion_radio/ui-new
106107
-D MAX_CONTACTS=300
107108
-D MAX_GROUP_CHANNELS=8
109+
-D DISPLAY_CLASS=SSD1306Display
108110
-D SERIAL_TX=D6
109111
-D SERIAL_RX=D7
110112
; -D MESH_PACKET_LOGGING=1
111113
; -D MESH_DEBUG=1
112114
build_src_filter = ${Xiao_S3_WIO.build_src_filter}
115+
+<helpers/ui/SSD1306Display.cpp>
113116
+<helpers/esp32/*.cpp>
117+
+<helpers/ui/MomentaryButton.cpp>
114118
+<../examples/companion_radio/*.cpp>
119+
+<../examples/companion_radio/ui-new/*.cpp>
115120
lib_deps =
116121
${Xiao_S3_WIO.lib_deps}
117122
densaugeo/base64 @ ~1.4.0
123+
adafruit/Adafruit SSD1306 @ ^2.5.13

0 commit comments

Comments
 (0)