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/periodic.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'examples/periodic.rs') diff --git a/examples/periodic.rs b/examples/periodic.rs index ba2b493..f784118 100644 --- a/examples/periodic.rs +++ b/examples/periodic.rs @@ -8,24 +8,24 @@ extern crate panic_semihosting; use cortex_m_semihosting::hprintln; -use rtfm::{app, Instant}; +use rtfm::Instant; const PERIOD: u32 = 8_000_000; // NOTE: does NOT work on QEMU! -#[app(device = lm3s6965)] +#[rtfm::app(device = lm3s6965)] const APP: () = { #[init(schedule = [foo])] - fn init() { - schedule.foo(Instant::now() + PERIOD.cycles()).unwrap(); + fn init(c: init::Context) { + c.schedule.foo(Instant::now() + PERIOD.cycles()).unwrap(); } #[task(schedule = [foo])] - fn foo() { + fn foo(c: foo::Context) { let now = Instant::now(); - hprintln!("foo(scheduled = {:?}, now = {:?})", scheduled, now).unwrap(); + hprintln!("foo(scheduled = {:?}, now = {:?})", c.scheduled, now).unwrap(); - schedule.foo(scheduled + PERIOD.cycles()).unwrap(); + c.schedule.foo(c.scheduled + PERIOD.cycles()).unwrap(); } extern "C" { -- cgit v1.2.3