diff --git a/examples/stm32f3_blinky/Cargo.toml b/examples/stm32f3_blinky/Cargo.toml index 4cd21fc046..60c21a917b 100644 --- a/examples/stm32f3_blinky/Cargo.toml +++ b/examples/stm32f3_blinky/Cargo.toml @@ -5,10 +5,20 @@ readme = "README.md" name = "stm32f3-blinky" version = "0.1.0" +[workspace] + +[dependencies.rtic] +path = "../../rtic" +version = "2.0.0-alhpa.1" +features = ["thumbv7-backend"] + +[dependencies.rtic-monotonics] +path = "../../rtic-monotonics" +version = "1.0.0-alhpa.1" +features = ["cortex-m-systick"] + [dependencies] embedded-hal = "0.2.7" -rtic = { git = "https://github.com/rtic-rs/rtic", features = ["thumbv7-backend"] } -rtic-monotonics = { git = "https://github.com/rtic-rs/rtic", features = ["cortex-m-systick"] } panic-rtt-target = { version = "0.1.2", features = ["cortex-m"] } rtt-target = { version = "0.3.1", features = ["cortex-m"] } diff --git a/examples/stm32f3_blinky/src/main.rs b/examples/stm32f3_blinky/src/main.rs index e208d09de3..b6da714b93 100644 --- a/examples/stm32f3_blinky/src/main.rs +++ b/examples/stm32f3_blinky/src/main.rs @@ -15,8 +15,6 @@ use stm32f3xx_hal::prelude::*; mod app { use super::*; - rtic_monotonics::make_systick_handler!(); - #[shared] struct Shared {} @@ -32,7 +30,9 @@ mod app { let mut flash = cx.device.FLASH.constrain(); let mut rcc = cx.device.RCC.constrain(); - Systick::start(cx.core.SYST, 36_000_000); // default STM32F303 clock-rate is 36MHz + // Initialize the systick interrupt & obtain the token to prove that we did + let systick_mono_token = rtic_monotonics::create_systick_token!(); + Systick::start(cx.core.SYST, 36_000_000, systick_mono_token); // default STM32F303 clock-rate is 36MHz rtt_init_print!(); rprintln!("init");