summaryrefslogtreecommitdiff
path: root/src/systemtask
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-10-27 19:38:45 +0100
committerJF <jf@codingfield.com>2020-10-27 19:38:45 +0100
commit1bb2eb9dcd59fbb198be157e34b7ff25367adea0 (patch)
tree6bebf5630cedb1cf0476e590563964616d8dc456 /src/systemtask
parentab7acd0f076899fafb1cb5ff233a9c6b6b1ca15b (diff)
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.
Diffstat (limited to 'src/systemtask')
-rw-r--r--src/systemtask/SystemTask.cpp7
1 files changed, 6 insertions, 1 deletions
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 <drivers/InternalFlash.h>
#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();