diff options
Diffstat (limited to 'examples/ramfunc.rs')
-rw-r--r-- | examples/ramfunc.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/examples/ramfunc.rs b/examples/ramfunc.rs index 37ea82a7..5ff167a3 100644 --- a/examples/ramfunc.rs +++ b/examples/ramfunc.rs @@ -5,21 +5,21 @@ #![no_main] #![no_std] -extern crate panic_semihosting; - use cortex_m_semihosting::{debug, hprintln}; -use rtfm::app; +use panic_semihosting as _; -#[app(device = lm3s6965)] -const APP: () = { +#[rtic::app(device = lm3s6965)] +mod app { #[init(spawn = [bar])] - fn init() { - spawn.bar().unwrap(); + fn init(c: init::Context) -> init::LateResources { + c.spawn.bar().unwrap(); + + init::LateResources {} } #[inline(never)] #[task] - fn foo() { + fn foo(_: foo::Context) { hprintln!("foo").unwrap(); debug::exit(debug::EXIT_SUCCESS); @@ -29,8 +29,8 @@ const APP: () = { #[inline(never)] #[link_section = ".data.bar"] #[task(priority = 2, spawn = [foo])] - fn bar() { - spawn.foo().unwrap(); + fn bar(c: bar::Context) { + c.spawn.foo().unwrap(); } extern "C" { @@ -40,4 +40,4 @@ const APP: () = { #[link_section = ".data.UART1"] fn UART1(); } -}; +} |