diff options
author | 2019-04-21 20:10:40 +0200 | |
---|---|---|
committer | 2019-05-01 20:49:25 +0200 | |
commit | 1b4b006bab7ee05e403a4fc48ae751d037f95b1a (patch) | |
tree | 62d7e7ebf3f8fc6fff10cf92cb1623a025163006 /examples/capacity.rs | |
parent | a452700628e352e6ac01da9e16223a47752ca860 (diff) | |
download | rtic-1b4b006bab7ee05e403a4fc48ae751d037f95b1a.tar.gz rtic-1b4b006bab7ee05e403a4fc48ae751d037f95b1a.tar.zst rtic-1b4b006bab7ee05e403a4fc48ae751d037f95b1a.zip |
update examples
Diffstat (limited to '')
-rw-r--r-- | examples/capacity.rs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/examples/capacity.rs b/examples/capacity.rs index a7132ba0..07edd9b8 100644 --- a/examples/capacity.rs +++ b/examples/capacity.rs @@ -9,32 +9,31 @@ extern crate panic_semihosting; use cortex_m_semihosting::{debug, hprintln}; use lm3s6965::Interrupt; -use rtfm::app; -#[app(device = lm3s6965)] +#[rtfm::app(device = lm3s6965)] const APP: () = { #[init] - fn init() { + fn init(_: init::Context) { rtfm::pend(Interrupt::UART0); } #[interrupt(spawn = [foo, bar])] - fn UART0() { - spawn.foo(0).unwrap(); - spawn.foo(1).unwrap(); - spawn.foo(2).unwrap(); - spawn.foo(3).unwrap(); + fn UART0(c: UART0::Context) { + c.spawn.foo(0).unwrap(); + c.spawn.foo(1).unwrap(); + c.spawn.foo(2).unwrap(); + c.spawn.foo(3).unwrap(); - spawn.bar().unwrap(); + c.spawn.bar().unwrap(); } #[task(capacity = 4)] - fn foo(x: u32) { + fn foo(_: foo::Context, x: u32) { hprintln!("foo({})", x).unwrap(); } #[task] - fn bar() { + fn bar(_: bar::Context) { hprintln!("bar").unwrap(); debug::exit(debug::EXIT_SUCCESS); |