diff options
| author | Emil Fresk <emil.fresk@gmail.com> | 2023-01-02 14:34:05 +0100 |
|---|---|---|
| committer | Henrik Tjäder <henrik@tjaders.com> | 2023-03-01 00:31:01 +0100 |
| commit | 582c602912592ec7ebea3096aefa02aea99c2143 (patch) | |
| tree | 96b14a130788960ee06d7e80adec43a167b4844b /examples/periodic-at2.rs | |
| parent | 7614b96fe45240dafe91ae549e712b560e2d4c10 (diff) | |
Old xtask test pass
Diffstat (limited to 'examples/periodic-at2.rs')
| -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 4719bdb..ec9adcc 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(); } } |
