diff options
author | 2020-10-05 18:25:15 +0200 | |
---|---|---|
committer | 2020-10-05 18:25:15 +0200 | |
commit | eec0908024d9b4127ed496b4781adc08000cc2c2 (patch) | |
tree | f128b3d91ea4ac0f171ab334d4517552a6803d01 /examples/init.rs | |
parent | 9d2598dc071882a94b813ab1d9ddf49092546257 (diff) | |
parent | f493f21359ccb3ab4643d9470f3581532f47593a (diff) | |
download | rtic-eec0908024d9b4127ed496b4781adc08000cc2c2.tar.gz rtic-eec0908024d9b4127ed496b4781adc08000cc2c2.tar.zst rtic-eec0908024d9b4127ed496b4781adc08000cc2c2.zip |
Merge branch 'master' into always_late_resources
Diffstat (limited to '')
-rw-r--r-- | examples/init.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/init.rs b/examples/init.rs index d5cebbaa..6ac284a1 100644 --- a/examples/init.rs +++ b/examples/init.rs @@ -9,7 +9,7 @@ use cortex_m_semihosting::{debug, hprintln}; use panic_semihosting as _; #[rtic::app(device = lm3s6965, peripherals = true)] -const APP: () = { +mod app { #[init] fn init(cx: init::Context) -> init::LateResources { static mut X: u32 = 0; @@ -23,10 +23,14 @@ const APP: () = { // Safe access to local `static mut` variable let _x: &'static mut u32 = X; + // Access to the critical section token, + // to indicate that this is a critical seciton + let _cs_token: bare_metal::CriticalSection = cx.cs; + hprintln!("init").unwrap(); debug::exit(debug::EXIT_SUCCESS); init::LateResources {} } -}; +} |