aboutsummaryrefslogtreecommitdiff
path: root/examples/binds.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/binds.rs')
-rw-r--r--examples/binds.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/binds.rs b/examples/binds.rs
index 56565cbe..601f245a 100644
--- a/examples/binds.rs
+++ b/examples/binds.rs
@@ -23,21 +23,22 @@ mod app {
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {
rtic::pend(Interrupt::UART0);
- hprintln!("init").unwrap();
+ hprintln!("init");
(Shared {}, Local {}, init::Monotonics())
}
#[idle]
fn idle(_: idle::Context) -> ! {
- 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
}
}
@@ -49,7 +50,6 @@ mod app {
"foo called {} time{}",
*cx.local.times,
if *cx.local.times > 1 { "s" } else { "" }
- )
- .unwrap();
+ );
}
}