aboutsummaryrefslogtreecommitdiff
path: root/examples/cancel-reschedule.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-11-09 10:15:11 +0000
committerGitHub <noreply@github.com>2021-11-09 10:15:11 +0000
commitb4929032d5f013985becb88faf9b847236afe172 (patch)
treebbdd1ccb6ebda2e4be8362709a8188ae1bed895a /examples/cancel-reschedule.rs
parent4f3c5baf49bde675dfa8faf6e5311d38cbb5d654 (diff)
parent5ab5112271a9dbef6d875ad89706fc726e126b95 (diff)
Merge #547
547: New monotonic trait r=AfoHT a=korken89 Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
Diffstat (limited to 'examples/cancel-reschedule.rs')
-rw-r--r--examples/cancel-reschedule.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/cancel-reschedule.rs b/examples/cancel-reschedule.rs
index c5ef2e7..e0bdaae 100644
--- a/examples/cancel-reschedule.rs
+++ b/examples/cancel-reschedule.rs
@@ -10,8 +10,7 @@ use panic_semihosting as _;
#[rtic::app(device = lm3s6965, dispatchers = [SSI0])]
mod app {
use cortex_m_semihosting::{debug, hprintln};
- use rtic::time::duration::*;
- use systick_monotonic::Systick;
+ use systick_monotonic::*;
#[monotonic(binds = SysTick, default = true)]
type MyMono = Systick<100>; // 100 Hz / 10 ms granularity
@@ -32,7 +31,7 @@ mod app {
hprintln!("init").ok();
// Schedule `foo` to run 1 second in the future
- foo::spawn_after(1.seconds()).unwrap();
+ foo::spawn_after(1.secs()).unwrap();
(
Shared {},
@@ -46,8 +45,8 @@ mod app {
hprintln!("foo").ok();
// Schedule `bar` to run 2 seconds in the future (1 second after foo runs)
- let spawn_handle = baz::spawn_after(2.seconds()).unwrap();
- bar::spawn_after(1.seconds(), spawn_handle, false).unwrap(); // Change to true
+ let spawn_handle = baz::spawn_after(2.secs()).unwrap();
+ bar::spawn_after(1.secs(), spawn_handle, false).unwrap(); // Change to true
}
#[task]
@@ -57,7 +56,7 @@ mod app {
if do_reschedule {
// Reschedule baz 2 seconds from now, instead of the original 1 second
// from now.
- baz_handle.reschedule_after(2.seconds()).unwrap();
+ baz_handle.reschedule_after(2.secs()).unwrap();
// Or baz_handle.reschedule_at(/* time */)
} else {
// Or cancel it