From 7bec2347663d0a8c361f48adae7a2fa7e84abede Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Sun, 26 Dec 2021 11:42:14 +0100 Subject: [PATCH] Improved docs on where the 12 MHz comes from in SysTick --- examples/cancel-reschedule.rs | 2 +- examples/common.rs | 2 ++ examples/periodic.rs | 1 + examples/schedule.rs | 2 +- examples/t-schedule.rs | 1 + 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/cancel-reschedule.rs b/examples/cancel-reschedule.rs index e0bdaae80e..a38a9c4eae 100644 --- a/examples/cancel-reschedule.rs +++ b/examples/cancel-reschedule.rs @@ -25,7 +25,7 @@ mod app { fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) { let systick = cx.core.SYST; - // Initialize the monotonic + // Initialize the monotonic (SysTick rate in QEMU is 12 MHz) let mono = Systick::new(systick, 12_000_000); hprintln!("init").ok(); diff --git a/examples/common.rs b/examples/common.rs index 26a5c8fb33..1fe671e61a 100644 --- a/examples/common.rs +++ b/examples/common.rs @@ -33,6 +33,8 @@ mod app { #[init] fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) { let systick = cx.core.SYST; + + // Initialize the monotonic (SysTick rate in QEMU is 12 MHz) let mono = Systick::new(systick, 12_000_000); // Spawn the task `foo` directly after `init` finishes diff --git a/examples/periodic.rs b/examples/periodic.rs index 495054ea42..40c69257e7 100644 --- a/examples/periodic.rs +++ b/examples/periodic.rs @@ -25,6 +25,7 @@ mod app { fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) { let systick = cx.core.SYST; + // Initialize the monotonic (SysTick rate in QEMU is 12 MHz) let mono = Systick::new(systick, 12_000_000); foo::spawn_after(1.secs()).unwrap(); diff --git a/examples/schedule.rs b/examples/schedule.rs index 446a382892..5bad5a30ad 100644 --- a/examples/schedule.rs +++ b/examples/schedule.rs @@ -25,7 +25,7 @@ mod app { fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) { let systick = cx.core.SYST; - // Initialize the monotonic + // Initialize the monotonic (SysTick rate in QEMU is 12 MHz) let mono = Systick::new(systick, 12_000_000); hprintln!("init").ok(); diff --git a/examples/t-schedule.rs b/examples/t-schedule.rs index 6ee08afbe9..5ec420873d 100644 --- a/examples/t-schedule.rs +++ b/examples/t-schedule.rs @@ -25,6 +25,7 @@ mod app { fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) { let systick = cx.core.SYST; + // Initialize the monotonic (SysTick rate in QEMU is 12 MHz) let mono = Systick::new(systick, 12_000_000); debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator