From 582c602912592ec7ebea3096aefa02aea99c2143 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Mon, 2 Jan 2023 14:34:05 +0100 Subject: Old xtask test pass --- examples/periodic.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'examples/periodic.rs') diff --git a/examples/periodic.rs b/examples/periodic.rs index 13ca7c85..2f9e8e6a 100644 --- a/examples/periodic.rs +++ b/examples/periodic.rs @@ -2,7 +2,6 @@ #![deny(unsafe_code)] #![deny(warnings)] -#![deny(missing_docs)] #![no_main] #![no_std] @@ -29,21 +28,21 @@ mod app { // Initialize the monotonic (SysTick rate in QEMU is 12 MHz) let mono = Systick::new(systick, 12_000_000); - foo::spawn_after(1.secs()).unwrap(); + foo::spawn_after(100.millis()).unwrap(); (Shared {}, Local {}, init::Monotonics(mono)) } #[task(local = [cnt: u32 = 0])] fn foo(cx: foo::Context) { - hprintln!("foo"); + hprintln!("foo").ok(); *cx.local.cnt += 1; if *cx.local.cnt == 4 { debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator } - // Periodic ever 1 seconds - foo::spawn_after(1.secs()).unwrap(); + // Periodic every 100ms + foo::spawn_after(100.millis()).unwrap(); } } -- cgit v1.2.3