Pass WDT config around
By passing WDT config around we can control it more easily and promote sharing it between files.
This commit is contained in:
parent
0aa2a9ac27
commit
651eec0242
2 changed files with 9 additions and 6 deletions
examples/boot/bootloader/nrf/src
|
@ -6,6 +6,7 @@ use cortex_m_rt::{entry, exception};
|
|||
use defmt_rtt as _;
|
||||
use embassy_boot_nrf::*;
|
||||
use embassy_nrf::nvmc::Nvmc;
|
||||
use embassy_nrf::wdt;
|
||||
|
||||
#[entry]
|
||||
fn main() -> ! {
|
||||
|
@ -20,8 +21,14 @@ fn main() -> ! {
|
|||
*/
|
||||
|
||||
let mut bl = BootLoader::default();
|
||||
|
||||
let mut wdt_config = wdt::Config::default();
|
||||
wdt_config.timeout_ticks = 32768 * 5; // timeout seconds
|
||||
wdt_config.run_during_sleep = true;
|
||||
wdt_config.run_during_debug_halt = false;
|
||||
|
||||
let start = bl.prepare(&mut SingleFlashConfig::new(&mut BootFlash::<_, 4096>::new(
|
||||
WatchdogFlash::start(Nvmc::new(p.NVMC), p.WDT, 5),
|
||||
WatchdogFlash::start(Nvmc::new(p.NVMC), p.WDT, wdt_config),
|
||||
)));
|
||||
unsafe { bl.load(start) }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue