573: Improved docs on where the 12 MHz comes from in SysTick r=perlindgren a=korken89



Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
This commit is contained in:
bors[bot] 2021-12-26 11:43:54 +00:00 committed by GitHub
commit f990268147
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 2 deletions

View file

@ -25,7 +25,7 @@ mod app {
fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) { fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) {
let systick = cx.core.SYST; 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); let mono = Systick::new(systick, 12_000_000);
hprintln!("init").ok(); hprintln!("init").ok();

View file

@ -33,6 +33,8 @@ mod app {
#[init] #[init]
fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) { fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) {
let systick = cx.core.SYST; let systick = cx.core.SYST;
// Initialize the monotonic (SysTick rate in QEMU is 12 MHz)
let mono = Systick::new(systick, 12_000_000); let mono = Systick::new(systick, 12_000_000);
// Spawn the task `foo` directly after `init` finishes // Spawn the task `foo` directly after `init` finishes

View file

@ -25,6 +25,7 @@ mod app {
fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) { fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) {
let systick = cx.core.SYST; let systick = cx.core.SYST;
// Initialize the monotonic (SysTick rate in QEMU is 12 MHz)
let mono = Systick::new(systick, 12_000_000); let mono = Systick::new(systick, 12_000_000);
foo::spawn_after(1.secs()).unwrap(); foo::spawn_after(1.secs()).unwrap();

View file

@ -25,7 +25,7 @@ mod app {
fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) { fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) {
let systick = cx.core.SYST; 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); let mono = Systick::new(systick, 12_000_000);
hprintln!("init").ok(); hprintln!("init").ok();

View file

@ -25,6 +25,7 @@ mod app {
fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) { fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) {
let systick = cx.core.SYST; let systick = cx.core.SYST;
// Initialize the monotonic (SysTick rate in QEMU is 12 MHz)
let mono = Systick::new(systick, 12_000_000); let mono = Systick::new(systick, 12_000_000);
debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator