Skip to content

Commit 04376a2

Browse files
committed
fix: wait a few seconds before reset to allow dfu replies
1 parent 72bbd37 commit 04376a2

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

firmware/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

firmware/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
edition = "2021"
33
name = "watchful"
4-
version = "0.3.1"
4+
version = "0.3.2"
55
license = "MIT OR Apache-2.0"
66
build = "build.rs"
77
resolver = "2"

firmware/src/ble.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use defmt::{info, unwrap, warn};
22
use embassy_executor::Spawner;
33
use embassy_futures::select::{select, Either};
4-
use embassy_time::{with_timeout, Duration};
4+
use embassy_time::{with_timeout, Duration, Timer};
55
use embedded_storage_async::nor_flash::NorFlash;
66
use heapless::Vec;
77
use nrf_dfu_target::prelude::{DfuRequest, DfuStatus, DfuTarget, FirmwareInfo, FirmwareType, HardwareInfo};
@@ -314,6 +314,7 @@ async fn process(
314314

315315
if let Some(DfuStatus::DoneReset) = result {
316316
warn!("DFU done! Supposed to reset!");
317+
Timer::after(Duration::from_secs(4)).await;
317318
cortex_m::peripheral::SCB::sys_reset();
318319
}
319320
}

0 commit comments

Comments
 (0)