diff options
Diffstat (limited to 'examples/schedule.rs')
-rw-r--r-- | examples/schedule.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/examples/schedule.rs b/examples/schedule.rs index eaafb4c9..27d3bd1f 100644 --- a/examples/schedule.rs +++ b/examples/schedule.rs @@ -5,25 +5,24 @@ #![no_main] #![no_std] -extern crate panic_semihosting; - use cortex_m_semihosting::hprintln; -use rtfm::Instant; +use panic_halt as _; +use rtfm::cyccnt::{Instant, U32Ext as _}; // NOTE: does NOT work on QEMU! -#[rtfm::app(device = lm3s6965)] +#[rtfm::app(device = lm3s6965, monotonic = rtfm::cyccnt::CYCCNT)] const APP: () = { #[init(schedule = [foo, bar])] - fn init(c: init::Context) { + fn init(cx: init::Context) { let now = Instant::now(); hprintln!("init @ {:?}", now).unwrap(); // Schedule `foo` to run 8e6 cycles (clock cycles) in the future - c.schedule.foo(now + 8_000_000.cycles()).unwrap(); + cx.schedule.foo(now + 8_000_000.cycles()).unwrap(); // Schedule `bar` to run 4e6 cycles in the future - c.schedule.bar(now + 4_000_000.cycles()).unwrap(); + cx.schedule.bar(now + 4_000_000.cycles()).unwrap(); } #[task] |