diff options
author | 2019-07-10 22:42:44 +0200 | |
---|---|---|
committer | 2019-07-10 22:42:44 +0200 | |
commit | 9195038c87703fc94b6e99f6de593886d51c2b19 (patch) | |
tree | 56855952357fe5bb689504ed8a6348dc3c1f3718 /examples/static.rs | |
parent | 14d63f496118f4243f28ddf3218523aa36a80322 (diff) | |
download | rtic-9195038c87703fc94b6e99f6de593886d51c2b19.tar.gz rtic-9195038c87703fc94b6e99f6de593886d51c2b19.tar.zst rtic-9195038c87703fc94b6e99f6de593886d51c2b19.zip |
implement RFC #212
Diffstat (limited to 'examples/static.rs')
-rw-r--r-- | examples/static.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/static.rs b/examples/static.rs index 5eb7b197..4af7ee67 100644 --- a/examples/static.rs +++ b/examples/static.rs @@ -11,8 +11,8 @@ use panic_semihosting as _; #[rtfm::app(device = lm3s6965)] const APP: () = { - extern "C" { - static KEY: u32; + struct Resources { + key: u32, } #[init] @@ -20,18 +20,18 @@ const APP: () = { rtfm::pend(Interrupt::UART0); rtfm::pend(Interrupt::UART1); - init::LateResources { KEY: 0xdeadbeef } + init::LateResources { key: 0xdeadbeef } } - #[task(binds = UART0, resources = [KEY])] + #[task(binds = UART0, resources = [&key])] fn uart0(c: uart0::Context) { - hprintln!("UART0(KEY = {:#x})", c.resources.KEY).unwrap(); + hprintln!("UART0(key = {:#x})", c.resources.key).unwrap(); debug::exit(debug::EXIT_SUCCESS); } - #[task(binds = UART1, priority = 2, resources = [KEY])] + #[task(binds = UART1, priority = 2, resources = [&key])] fn uart1(c: uart1::Context) { - hprintln!("UART1(KEY = {:#x})", c.resources.KEY).unwrap(); + hprintln!("UART1(key = {:#x})", c.resources.key).unwrap(); } }; |