Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions examples/companion_radio/ui-new/UITask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,22 @@ void UITask::loop() {
if (millis() > next_batt_chck) {
uint16_t milliVolts = getBattMilliVolts();
if (milliVolts > 0 && milliVolts < AUTO_SHUTDOWN_MILLIVOLTS) {

// show low battery shutdown alert
// we should only do this for eink displays, which will persist after power loss
#ifdef THINKNODE_M1
if (_display != NULL) {
_display->startFrame();
_display->setTextSize(2);
_display->setColor(DisplayDriver::RED);
_display->drawTextCentered(_display->width() / 2, 20, "Low Battery.");
_display->drawTextCentered(_display->width() / 2, 40, "Shutting Down!");
_display->endFrame();
}
#endif

shutdown();

}
next_batt_chck = millis() + 8000;
}
Expand Down
8 changes: 8 additions & 0 deletions src/helpers/nrf52/ThinkNodeM1Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ class ThinkNodeM1Board : public mesh::MainBoard {
}

void powerOff() override {

// turn off all leds, sd_power_system_off will not do this for us
#ifdef P_LORA_TX_LED
digitalWrite(P_LORA_TX_LED, LOW);
#endif

// power off board
sd_power_system_off();

}
};
1 change: 1 addition & 0 deletions variants/thinknode_m1/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ build_flags =
-D DISPLAY_CLASS=GxEPDDisplay
-D OFFLINE_QUEUE_SIZE=256
-D PIN_BUZZER=6
-D AUTO_SHUTDOWN_MILLIVOLTS=3300
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${ThinkNode_M1.build_src_filter}
Expand Down