aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-rt/examples/state.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cortex-m-rt/examples/state.rs')
-rw-r--r--cortex-m-rt/examples/state.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/cortex-m-rt/examples/state.rs b/cortex-m-rt/examples/state.rs
index dbacdaf..573914f 100644
--- a/cortex-m-rt/examples/state.rs
+++ b/cortex-m-rt/examples/state.rs
@@ -5,20 +5,20 @@
#![no_main]
#![no_std]
-#[macro_use(entry, exception)]
extern crate cortex_m_rt as rt;
extern crate panic_semihosting;
-// the program entry point
-entry!(main);
+use rt::{entry, exception};
+#[entry]
fn main() -> ! {
loop {}
}
// exception handler with state
-exception!(SysTick, sys_tick, state: u32 = 0);
+#[exception]
+fn SysTick() {
+ static mut STATE: u32 = 0;
-fn sys_tick(state: &mut u32) {
- *state += 1;
+ *STATE += 1;
}