Skip to content

Commit fcb487a

Browse files
Merge branch 'main' into main
2 parents b521b53 + 71d1f5b commit fcb487a

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

doc/BLEFS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ There are two relevant UUIDs in this protocol: the version characteristic, and t
1414

1515
UUID: `adaf0100-4669-6c65-5472-616e73666572`
1616

17-
The version characteristic returns the version of the protocol to which the sender adheres. It returns a single unsigned 32-bit integer. The latest version at the time of writing this is 4.
17+
The version characteristic returns the version of the protocol to which the sender adheres. It returns a single unsigned 16-bit integer. The latest version at the time of writing this is 4.
1818

1919
### Transfer
2020

@@ -71,7 +71,7 @@ To begin writing to a file, a header must first be sent. The header packet shoul
7171
- Unsigned 32-bit integer encoding the size of the file that will be sent
7272
- File path: UTF-8 encoded string that is _not_ null terminated.
7373

74-
To continue reading the file after this initial packet, the following packet should be sent until all the data has been sent and a response had been received with 0 free space. No close command is required after the data has been received.
74+
To continue writing the file after this initial packet, the following packet should be sent until all the data has been sent and a response had been received with 0 free space. No close command is required after the data has been received.
7575

7676
- Command (single byte): `0x22`
7777
- Status: `0x01`

src/systemtask/SystemTask.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -310,14 +310,14 @@ void SystemTask::Work() {
310310
if (state != SystemTaskState::GoingToSleep) {
311311
break;
312312
}
313-
if (BootloaderVersion::IsValid()) {
314-
// First versions of the bootloader do not expose their version and cannot initialize the SPI NOR FLASH
315-
// if it's in sleep mode. Avoid bricked device by disabling sleep mode on these versions.
316-
spiNorFlash.Sleep();
317-
}
318313

319-
// Must keep SPI awake when still updating the display for always on
314+
// Must keep SPI and flash awake when still updating the display for always on
320315
if (msg == Messages::OnDisplayTaskSleeping) {
316+
if (BootloaderVersion::IsValid()) {
317+
// First versions of the bootloader do not expose their version and cannot initialize the SPI NOR FLASH
318+
// if it's in sleep mode. Avoid bricked device by disabling sleep mode on these versions.
319+
spiNorFlash.Sleep();
320+
}
321321
spi.Sleep();
322322
}
323323

@@ -409,14 +409,13 @@ void SystemTask::GoToRunning() {
409409
// SPI only switched off when entering Sleeping, not AOD or GoingToSleep
410410
if (state == SystemTaskState::Sleeping) {
411411
spi.Wakeup();
412+
spiNorFlash.Wakeup();
412413
}
413414

414415
// Double Tap needs the touch screen to be in normal mode
415416
if (!settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::DoubleTap)) {
416417
touchPanel.Wakeup();
417418
}
418-
419-
spiNorFlash.Wakeup();
420419
}
421420

422421
displayApp.PushMessage(Pinetime::Applications::Display::Messages::GoToRunning);

0 commit comments

Comments
 (0)