aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/ble/DfuService.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/ble/DfuService.cpp')
-rw-r--r--src/components/ble/DfuService.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/components/ble/DfuService.cpp b/src/components/ble/DfuService.cpp
index b3f2ff10..2427513d 100644
--- a/src/components/ble/DfuService.cpp
+++ b/src/components/ble/DfuService.cpp
@@ -124,9 +124,11 @@ int DfuService::WritePacketHandler(uint16_t connectionHandle, os_mbuf* om) {
bootloaderSize,
applicationSize);
- // wait until SystemTask has finished waking up all devices
- while (systemTask.IsSleeping()) {
- vTaskDelay(50); // 50ms
+ // Wait until SystemTask has disabled sleeping
+ // This isn't quite correct, as we don't actually know
+ // if BleFirmwareUpdateStarted has been received yet
+ while (!systemTask.IsSleepDisabled()) {
+ vTaskDelay(pdMS_TO_TICKS(5));
}
dfuImage.Erase();