aboutsummaryrefslogtreecommitdiff
path: root/examples/resource.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/resource.rs')
-rw-r--r--examples/resource.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/resource.rs b/examples/resource.rs
index 2361fd00..273af26a 100644
--- a/examples/resource.rs
+++ b/examples/resource.rs
@@ -10,7 +10,8 @@ use lm3s6965::Interrupt;
use panic_semihosting as _;
#[rtic::app(device = lm3s6965)]
-const APP: () = {
+mod app {
+ #[resources]
struct Resources {
// A resource
#[init(0)]
@@ -18,9 +19,11 @@ const APP: () = {
}
#[init]
- fn init(_: init::Context) {
+ fn init(_: init::Context) -> init::LateResources {
rtic::pend(Interrupt::UART0);
rtic::pend(Interrupt::UART1);
+
+ init::LateResources {}
}
// `shared` cannot be accessed from this context
@@ -52,4 +55,4 @@ const APP: () = {
hprintln!("UART1: shared = {}", cx.resources.shared).unwrap();
}
-};
+}