aboutsummaryrefslogtreecommitdiff
path: root/examples/hardware.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/hardware.rs')
-rw-r--r--examples/hardware.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/hardware.rs b/examples/hardware.rs
index 60632247..590bf6ab 100644
--- a/examples/hardware.rs
+++ b/examples/hardware.rs
@@ -24,7 +24,7 @@ mod app {
// `init` returns because interrupts are disabled
rtic::pend(Interrupt::UART0); // equivalent to NVIC::pend
- hprintln!("init").unwrap();
+ hprintln!("init");
(Shared {}, Local {}, init::Monotonics())
}
@@ -33,14 +33,15 @@ mod app {
fn idle(_: idle::Context) -> ! {
// interrupts are enabled again; the `UART0` handler runs at this point
- hprintln!("idle").unwrap();
+ hprintln!("idle");
rtic::pend(Interrupt::UART0);
- debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator
-
loop {
+ // Exit moved after nop to ensure that rtic::pend gets
+ // to run before exiting
cortex_m::asm::nop();
+ debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator
}
}
@@ -53,7 +54,6 @@ mod app {
"UART0 called {} time{}",
*cx.local.times,
if *cx.local.times > 1 { "s" } else { "" }
- )
- .unwrap();
+ );
}
}