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.
This commit is contained in:
JF
2020-10-27 19:38:45 +01:00
parent ab7acd0f07
commit 1bb2eb9dcd
5 changed files with 49 additions and 4 deletions

View File

@@ -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();