From 1b4b006bab7ee05e403a4fc48ae751d037f95b1a Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sun, 21 Apr 2019 20:10:40 +0200 Subject: update examples --- examples/schedule.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'examples/schedule.rs') diff --git a/examples/schedule.rs b/examples/schedule.rs index fd633473..eaafb4c9 100644 --- a/examples/schedule.rs +++ b/examples/schedule.rs @@ -8,31 +8,31 @@ extern crate panic_semihosting; use cortex_m_semihosting::hprintln; -use rtfm::{app, Instant}; +use rtfm::Instant; // NOTE: does NOT work on QEMU! -#[app(device = lm3s6965)] +#[rtfm::app(device = lm3s6965)] const APP: () = { #[init(schedule = [foo, bar])] - fn init() { + fn init(c: init::Context) { let now = Instant::now(); hprintln!("init @ {:?}", now).unwrap(); // Schedule `foo` to run 8e6 cycles (clock cycles) in the future - schedule.foo(now + 8_000_000.cycles()).unwrap(); + c.schedule.foo(now + 8_000_000.cycles()).unwrap(); // Schedule `bar` to run 4e6 cycles in the future - schedule.bar(now + 4_000_000.cycles()).unwrap(); + c.schedule.bar(now + 4_000_000.cycles()).unwrap(); } #[task] - fn foo() { + fn foo(_: foo::Context) { hprintln!("foo @ {:?}", Instant::now()).unwrap(); } #[task] - fn bar() { + fn bar(_: bar::Context) { hprintln!("bar @ {:?}", Instant::now()).unwrap(); } -- cgit v1.2.3