From 1bb2eb9dcd59fbb198be157e34b7ff25367adea0 Mon Sep 17 00:00:00 2001 From: JF Date: Tue, 27 Oct 2020 19:38:45 +0100 Subject: Disable sleep mode on the SPI NOR Flash when the version is unknown. This is because the current bootloader (which does not exposes its version) cannot initialize the chip when it's in sleep mode. This feature will be re-enabled when the bootloader expses it's version. --- src/systemtask/SystemTask.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/systemtask') diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 3efe21b8..dac4ce29 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -13,6 +13,7 @@ #include #include "main.h" #include "components/ble/NimbleController.h" +#include "../BootloaderVersion.h" using namespace Pinetime::System; @@ -161,7 +162,11 @@ void SystemTask::Work() { ReloadIdleTimer(); break; case Messages::OnDisplayTaskSleeping: - spiNorFlash.Sleep(); + 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(); + } lcd.Sleep(); touchPanel.Sleep(); -- cgit v1.2.3-70-g09d2