From ce94b3d67a21ab49cdfd1b6f574d940ca7bd0199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Wed, 10 Apr 2019 11:24:38 +0200 Subject: [PATCH] [apps] Redraw battery pictogram after a reset --- apps/apps_container.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/apps_container.cpp b/apps/apps_container.cpp index 34636cf7a..c79eac063 100644 --- a/apps/apps_container.cpp +++ b/apps/apps_container.cpp @@ -152,11 +152,13 @@ bool AppsContainer::dispatchEvent(Ion::Events::Event event) { if (event == Ion::Events::USBEnumeration) { if (Ion::USB::isPlugged()) { App::Snapshot * activeSnapshot = (activeApp() == nullptr ? appSnapshotAtIndex(0) : activeApp()->snapshot()); + /* Just after a software update, the battery timer does not have time to + * fire before the calculator enters DFU mode. As the DFU mode blocks the + * event loop, we update the battery state "manually" here. + * We do it before switching to USB application to redraw the battery + * pictogram. */ + updateBatteryState(); if (switchTo(usbConnectedAppSnapshot())) { - /* Just after a software update, the battery timer does not have time to - * fire before the calculator enters DFU mode. As the DFU mode blocks the - * event loop, we update the battery state "manually" here. */ - updateBatteryState(); Ion::USB::DFU(); bool switched = switchTo(activeSnapshot); assert(switched);