diff options
Diffstat (limited to 'examples/destructure.rs')
-rw-r--r-- | examples/destructure.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/destructure.rs b/examples/destructure.rs index 1756bd9e..e7c53237 100644 --- a/examples/destructure.rs +++ b/examples/destructure.rs @@ -10,7 +10,8 @@ use lm3s6965::Interrupt; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -const APP: () = { +mod app { + #[resources] struct Resources { // Some resources to work with #[init(0)] @@ -22,9 +23,11 @@ const APP: () = { } #[init] - fn init(_: init::Context) { + fn init(_: init::Context) -> init::LateResources { rtic::pend(Interrupt::UART0); rtic::pend(Interrupt::UART1); + + init::LateResources {} } // Direct destructure @@ -44,4 +47,4 @@ const APP: () = { hprintln!("UART0: a = {}, b = {}, c = {}", a, b, c).unwrap(); } -}; +} |