diff options
author | 2021-05-27 16:18:46 +0000 | |
---|---|---|
committer | 2021-05-27 16:18:46 +0000 | |
commit | 0b0bb1bfa9de42e951f538b8f43bfcc53709a241 (patch) | |
tree | 8d83566481df0925920b703e63dc310b87c39bb9 /examples/schedule.rs | |
parent | aad8f81991c3495f225df80d7c8456faecd40728 (diff) | |
parent | c17348d2904b60713e1914567ba5566134165103 (diff) | |
download | rtic-0b0bb1bfa9de42e951f538b8f43bfcc53709a241.tar.gz rtic-0b0bb1bfa9de42e951f538b8f43bfcc53709a241.tar.zst rtic-0b0bb1bfa9de42e951f538b8f43bfcc53709a241.zip |
Merge #485v0.6.0-alpha.4
485: New codegen structure to eliminate issues with paths r=korken89 a=korken89
Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
Diffstat (limited to 'examples/schedule.rs')
-rw-r--r-- | examples/schedule.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/examples/schedule.rs b/examples/schedule.rs index b89e5191..bb5119c2 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<MONO_HZ>; #[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(); } } |