aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-rt/examples/state.rs
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2018-08-18 22:45:13 +0200
committerGravatar Jorge Aparicio <jorge@japaric.io> 2018-08-31 00:38:10 +0200
commitf2a155a0715cb99cbace2eca7ab5fcfa93d106d2 (patch)
tree2066fedfc4218770521dac35337073088c1a6759 /cortex-m-rt/examples/state.rs
parent0fb051055a0340ad6c5b59d18183c260468e455f (diff)
downloadcortex-m-f2a155a0715cb99cbace2eca7ab5fcfa93d106d2.tar.gz
cortex-m-f2a155a0715cb99cbace2eca7ab5fcfa93d106d2.tar.zst
cortex-m-f2a155a0715cb99cbace2eca7ab5fcfa93d106d2.zip
turn macros into attributes
Diffstat (limited to 'cortex-m-rt/examples/state.rs')
-rw-r--r--cortex-m-rt/examples/state.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/cortex-m-rt/examples/state.rs b/cortex-m-rt/examples/state.rs
index dbacdaf..72ca194 100644
--- a/cortex-m-rt/examples/state.rs
+++ b/cortex-m-rt/examples/state.rs
@@ -5,20 +5,18 @@
#![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);
-
-fn sys_tick(state: &mut u32) {
- *state += 1;
+#[exception(SysTick, static STATE: u32 = 0)]
+fn sys_tick() {
+ *STATE += 1;
}