diff options
Diffstat (limited to 'examples/cfg.rs')
| -rw-r--r-- | examples/cfg.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/examples/cfg.rs b/examples/cfg.rs index 02b39e3..d49f54c 100644 --- a/examples/cfg.rs +++ b/examples/cfg.rs @@ -11,7 +11,8 @@ use cortex_m_semihosting::hprintln; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -const APP: () = { +mod app { + #[resources] struct Resources { #[cfg(debug_assertions)] // <- `true` when using the `dev` profile #[init(0)] @@ -19,16 +20,20 @@ const APP: () = { } #[init(spawn = [foo])] - fn init(cx: init::Context) { + fn init(cx: init::Context) -> init::LateResources { cx.spawn.foo().unwrap(); cx.spawn.foo().unwrap(); + + init::LateResources {} } #[idle] fn idle(_: idle::Context) -> ! { debug::exit(debug::EXIT_SUCCESS); - loop {} + loop { + cortex_m::asm::nop(); + } } #[task(capacity = 2, resources = [count], spawn = [log])] @@ -64,4 +69,4 @@ const APP: () = { fn SSI0(); fn QEI0(); } -}; +} |
