aboutsummaryrefslogtreecommitdiff
path: root/examples/static.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/static.rs')
-rw-r--r--examples/static.rs14
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();
}
};