File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
examples/companion_radio/ui-new Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments