From 3576d24b8aae9e209d5c7690be9c4ce8001f6490 Mon Sep 17 00:00:00 2001 From: mark9064 <30447455+mark9064@users.noreply.github.com> Date: Sun, 19 Jul 2026 21:04:56 +0100 Subject: [PATCH] Keep external flash awake during AOD --- src/systemtask/SystemTask.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 9feeadedd9..826474a068 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -310,14 +310,14 @@ void SystemTask::Work() { if (state != SystemTaskState::GoingToSleep) { break; } - if (BootloaderVersion::IsValid()) { - // First versions of the bootloader do not expose their version and cannot initialize the SPI NOR FLASH - // if it's in sleep mode. Avoid bricked device by disabling sleep mode on these versions. - spiNorFlash.Sleep(); - } - // Must keep SPI awake when still updating the display for always on + // Must keep SPI and flash awake when still updating the display for always on if (msg == Messages::OnDisplayTaskSleeping) { + if (BootloaderVersion::IsValid()) { + // First versions of the bootloader do not expose their version and cannot initialize the SPI NOR FLASH + // if it's in sleep mode. Avoid bricked device by disabling sleep mode on these versions. + spiNorFlash.Sleep(); + } spi.Sleep(); } @@ -409,14 +409,13 @@ void SystemTask::GoToRunning() { // SPI only switched off when entering Sleeping, not AOD or GoingToSleep if (state == SystemTaskState::Sleeping) { spi.Wakeup(); + spiNorFlash.Wakeup(); } // Double Tap needs the touch screen to be in normal mode if (!settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::DoubleTap)) { touchPanel.Wakeup(); } - - spiNorFlash.Wakeup(); } displayApp.PushMessage(Pinetime::Applications::Display::Messages::GoToRunning);