Skip to content

Commit

Permalink
Add a static variable to an example.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpallant committed Jan 7, 2025
1 parent 515c54c commit f184110
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test-flip-link-app/examples/hello.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ use cortex_m_semihosting::{debug, hprintln};
use lm3s6965 as _;
use panic_semihosting as _;

static X: core::sync::atomic::AtomicU32 = core::sync::atomic::AtomicU32::new(0);

#[entry]
fn main() -> ! {
hprintln!("Hello, world!");
hprintln!(
"Hello, world!, X = {}",
X.load(core::sync::atomic::Ordering::Relaxed)
);

// exit QEMU
// NOTE do not run this on hardware; it can corrupt OpenOCD state
Expand Down

0 comments on commit f184110

Please sign in to comment.