diff options
author | 2020-10-11 18:38:38 +0200 | |
---|---|---|
committer | 2020-10-11 18:38:38 +0200 | |
commit | 524273c96a978299b64e51a9cdcc007585a0f170 (patch) | |
tree | 63e7f8bce84e1109e4814dbc7d48e837e5e60a6d /examples/schedule.rs | |
parent | c83b15b643346c54f09ef130b5abd5ca31abfcd5 (diff) | |
download | rtic-524273c96a978299b64e51a9cdcc007585a0f170.tar.gz rtic-524273c96a978299b64e51a9cdcc007585a0f170.tar.zst rtic-524273c96a978299b64e51a9cdcc007585a0f170.zip |
Now with spawn/schedule from anywhere
Diffstat (limited to 'examples/schedule.rs')
-rw-r--r-- | examples/schedule.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/schedule.rs b/examples/schedule.rs index 7e6adc1a..fa67a566 100644 --- a/examples/schedule.rs +++ b/examples/schedule.rs @@ -13,7 +13,7 @@ use rtic::cyccnt::{Instant, U32Ext as _}; // NOTE: does NOT work on QEMU! #[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)] mod app { - #[init(schedule = [foo, bar])] + #[init()] fn init(mut cx: init::Context) -> init::LateResources { // Initialize (enable) the monotonic timer (CYCCNT) cx.core.DCB.enable_trace(); @@ -28,10 +28,10 @@ mod app { hprintln!("init @ {:?}", now).unwrap(); // Schedule `foo` to run 8e6 cycles (clock cycles) in the future - cx.schedule.foo(now + 8_000_000.cycles()).unwrap(); + foo::schedule(now + 8_000_000.cycles()).unwrap(); // Schedule `bar` to run 4e6 cycles in the future - cx.schedule.bar(now + 4_000_000.cycles()).unwrap(); + bar::schedule(now + 4_000_000.cycles()).unwrap(); init::LateResources {} } |