aboutsummaryrefslogtreecommitdiff
path: root/examples/generics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/generics.rs')
-rw-r--r--examples/generics.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/examples/generics.rs b/examples/generics.rs
index 57c9b8eb..afcafa0a 100644
--- a/examples/generics.rs
+++ b/examples/generics.rs
@@ -12,6 +12,11 @@ use stm32f103xx::{SPI1, GPIOA};
app! {
device: stm32f103xx,
+ resources: {
+ static GPIOA: GPIOA;
+ static SPI1: SPI1;
+ },
+
tasks: {
EXTI0: {
path: exti0,
@@ -27,7 +32,12 @@ app! {
},
}
-fn init(_p: init::Peripherals) {}
+fn init(p: init::Peripherals) -> init::LateResourceValues {
+ init::LateResourceValues {
+ GPIOA: p.device.GPIOA,
+ SPI1: p.device.SPI1,
+ }
+}
fn idle() -> ! {
loop {