diff options
author | 2019-04-21 20:10:40 +0200 | |
---|---|---|
committer | 2019-05-01 20:49:25 +0200 | |
commit | 1b4b006bab7ee05e403a4fc48ae751d037f95b1a (patch) | |
tree | 62d7e7ebf3f8fc6fff10cf92cb1623a025163006 /examples/baseline.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/baseline.rs | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/examples/baseline.rs b/examples/baseline.rs index fdf36838..d743107d 100644 --- a/examples/baseline.rs +++ b/examples/baseline.rs @@ -9,24 +9,23 @@ extern crate panic_semihosting; use cortex_m_semihosting::{debug, hprintln}; use lm3s6965::Interrupt; -use rtfm::app; // NOTE: does NOT properly work on QEMU -#[app(device = lm3s6965)] +#[rtfm::app(device = lm3s6965)] const APP: () = { #[init(spawn = [foo])] - fn init() { - hprintln!("init(baseline = {:?})", start).unwrap(); + fn init(c: init::Context) { + hprintln!("init(baseline = {:?})", c.start).unwrap(); // `foo` inherits the baseline of `init`: `Instant(0)` - spawn.foo().unwrap(); + c.spawn.foo().unwrap(); } #[task(schedule = [foo])] - fn foo() { + fn foo(c: foo::Context) { static mut ONCE: bool = true; - hprintln!("foo(baseline = {:?})", scheduled).unwrap(); + hprintln!("foo(baseline = {:?})", c.scheduled).unwrap(); if *ONCE { *ONCE = false; @@ -38,11 +37,11 @@ const APP: () = { } #[interrupt(spawn = [foo])] - fn UART0() { - hprintln!("UART0(baseline = {:?})", start).unwrap(); + fn UART0(c: UART0::Context) { + hprintln!("UART0(baseline = {:?})", c.start).unwrap(); // `foo` inherits the baseline of `UART0`: its `start` time - spawn.foo().unwrap(); + c.spawn.foo().unwrap(); } extern "C" { |