[Bootloader] Enhance Global Stability

This commit is contained in:
Lisra-git
2023-04-07 23:58:28 +02:00
committed by Yaya-Cout
parent b4820d52e4
commit 0916996121
3 changed files with 61 additions and 53 deletions

View File

@@ -152,7 +152,10 @@ bool AppsContainer::dispatchEvent(Ion::Events::Event event) {
* We do it before switching to USB application to redraw the battery
* pictogram. */
updateBatteryState();
if (switchTo(usbConnectedAppSnapshot())) {
if (GlobalPreferences::sharedGlobalPreferences()->isInExamMode()) {
// If we are in exam mode, we don't switch to usb connected app
didProcessEvent = true;
} else if (switchTo(usbConnectedAppSnapshot())) {
Ion::USB::DFU(true);
// Update LED when exiting DFU mode
Ion::LED::updateColorWithPlugAndCharge();