aboutsummaryrefslogtreecommitdiff
path: root/examples/shared-with-init.rs
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2019-04-21 20:10:40 +0200
committerGravatar Jorge Aparicio <jorge@japaric.io> 2019-05-01 20:49:25 +0200
commit1b4b006bab7ee05e403a4fc48ae751d037f95b1a (patch)
tree62d7e7ebf3f8fc6fff10cf92cb1623a025163006 /examples/shared-with-init.rs
parenta452700628e352e6ac01da9e16223a47752ca860 (diff)
downloadrtic-1b4b006bab7ee05e403a4fc48ae751d037f95b1a.tar.gz
rtic-1b4b006bab7ee05e403a4fc48ae751d037f95b1a.tar.zst
rtic-1b4b006bab7ee05e403a4fc48ae751d037f95b1a.zip
update examples
Diffstat (limited to 'examples/shared-with-init.rs')
-rw-r--r--examples/shared-with-init.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/shared-with-init.rs b/examples/shared-with-init.rs
index 5ddd2cc3..0fb9191c 100644
--- a/examples/shared-with-init.rs
+++ b/examples/shared-with-init.rs
@@ -18,17 +18,17 @@ const APP: () = {
static mut SHARED: Option<MustBeSend> = None;
#[init(resources = [SHARED])]
- fn init() {
+ fn init(c: init::Context) {
// this `message` will be sent to task `UART0`
let message = MustBeSend;
- *resources.SHARED = Some(message);
+ *c.resources.SHARED = Some(message);
rtfm::pend(Interrupt::UART0);
}
#[interrupt(resources = [SHARED])]
- fn UART0() {
- if let Some(message) = resources.SHARED.take() {
+ fn UART0(c: UART0::Context) {
+ if let Some(message) = c.resources.SHARED.take() {
// `message` has been received
drop(message);