diff options
Diffstat (limited to '')
-rw-r--r-- | examples/periodic-at2.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/periodic-at2.rs b/examples/periodic-at2.rs index 4719bdb7..ec9adcc5 100644 --- a/examples/periodic-at2.rs +++ b/examples/periodic-at2.rs @@ -2,7 +2,6 @@ #![deny(unsafe_code)] #![deny(warnings)] -#![deny(missing_docs)] #![no_main] #![no_std] @@ -29,7 +28,7 @@ mod app { // Initialize the monotonic (SysTick rate in QEMU is 12 MHz) let mut mono = Systick::new(systick, 12_000_000); - foo::spawn_after(1.secs(), mono.now()).unwrap(); + foo::spawn_after(200.millis(), mono.now()).unwrap(); (Shared {}, Local {}, init::Monotonics(mono)) } @@ -37,7 +36,7 @@ mod app { // Using the explicit type of the timer implementation #[task(local = [cnt: u32 = 0])] fn foo(cx: foo::Context, instant: fugit::TimerInstantU64<100>) { - hprintln!("foo {:?}", instant); + hprintln!("foo {:?}", instant).ok(); *cx.local.cnt += 1; if *cx.local.cnt == 4 { @@ -53,10 +52,10 @@ mod app { // This remains agnostic to the timer implementation #[task(local = [cnt: u32 = 0])] fn bar(_cx: bar::Context, instant: <MyMono as rtic_monotonic::Monotonic>::Instant) { - hprintln!("bar {:?}", instant); + hprintln!("bar {:?}", instant).ok(); - // Spawn a new message with 1s offset to spawned time - let next_instant = instant + 1.secs(); + // Spawn a new message with 200ms offset to spawned time + let next_instant = instant + 200.millis(); foo::spawn_at(next_instant, next_instant).unwrap(); } } |