diff options
Diffstat (limited to 'examples/hardware.rs')
-rw-r--r-- | examples/hardware.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/examples/hardware.rs b/examples/hardware.rs index 9f1c664e..f6a2d375 100644 --- a/examples/hardware.rs +++ b/examples/hardware.rs @@ -10,14 +10,16 @@ use lm3s6965::Interrupt; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -const APP: () = { +mod app { #[init] - fn init(_: init::Context) { + fn init(_: init::Context) -> init::LateResources { // Pends the UART0 interrupt but its handler won't run until *after* // `init` returns because interrupts are disabled rtic::pend(Interrupt::UART0); // equivalent to NVIC::pend hprintln!("init").unwrap(); + + init::LateResources {} } #[idle] @@ -30,7 +32,9 @@ const APP: () = { debug::exit(debug::EXIT_SUCCESS); - loop {} + loop { + cortex_m::asm::nop(); + } } #[task(binds = UART0)] @@ -47,4 +51,4 @@ const APP: () = { ) .unwrap(); } -}; +} |