From 6155f1366a654512c2ca69b91fb2470c4faf3399 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Sun, 23 May 2021 14:11:51 +0200 Subject: Minor cleanup --- examples/schedule.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'examples') diff --git a/examples/schedule.rs b/examples/schedule.rs index b89e519..bb5119c 100644 --- a/examples/schedule.rs +++ b/examples/schedule.rs @@ -14,8 +14,10 @@ mod app { use dwt_systick_monotonic::DwtSystick; use rtic::time::duration::Seconds; + const MONO_HZ: u32 = 8_000_000; // 8 MHz + #[monotonic(binds = SysTick, default = true)] - type MyMono = DwtSystick<8_000_000>; // 8 MHz + type MyMono = DwtSystick; #[init()] fn init(cx: init::Context) -> (init::LateResources, init::Monotonics) { @@ -25,24 +27,24 @@ mod app { let mono = DwtSystick::new(&mut dcb, dwt, systick, 8_000_000); - hprintln!("init").unwrap(); + hprintln!("init").ok(); // Schedule `foo` to run 1 second in the future - foo::spawn_after(Seconds(1_u32)).unwrap(); + foo::spawn_after(Seconds(1_u32)).ok(); // Schedule `bar` to run 2 seconds in the future - bar::spawn_after(Seconds(2_u32)).unwrap(); + bar::spawn_after(Seconds(2_u32)).ok(); (init::LateResources {}, init::Monotonics(mono)) } #[task] fn foo(_: foo::Context) { - hprintln!("foo").unwrap(); + hprintln!("foo").ok(); } #[task] fn bar(_: bar::Context) { - hprintln!("bar").unwrap(); + hprintln!("bar").ok(); } } -- cgit v1.2.3