mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-12-01 16:04:33 +01:00
Merge #573
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:
commit
f990268147
5 changed files with 6 additions and 2 deletions
|
@ -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();
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue