diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index 241d44e2..50c82480 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -3327,6 +3327,11 @@ void UITask::loop() { if (curr) curr->poll(); + // A cable plugged in or pulled out: redraw at once, so the bolt by the + // battery follows it instead of waiting for the screen's next refresh. + { static bool ext = board.isExternalPowered(); + const bool now = board.isExternalPowered(); + if (now != ext) { ext = now; _next_refresh = 0; } } if (_display != NULL && _display->isOn()) { // Lock-screen password prompt