diff options
author | 2018-01-11 19:57:17 +0000 | |
---|---|---|
committer | 2018-01-11 19:57:17 +0000 | |
commit | 34edc41e9289e83468f68663a7f4a7f0f6cc2797 (patch) | |
tree | 128911a00f60bb7c0dc9c6ceb8c87e80e3935a99 /src/examples/_6_generics.rs | |
parent | dd12a6a14d2bb028c8da96cb510b67de31d28be4 (diff) | |
parent | 1be43fc489993e63577515063ceb8a83b14423b8 (diff) | |
download | rtic-release/v0.2.tar.gz rtic-release/v0.2.tar.zst rtic-release/v0.2.zip |
Auto merge of #63 - japaric:cortex-m-up, r=japaricrelease/v0.2
adapt to changes in the cortex-m crate
None
Diffstat (limited to '')
-rw-r--r-- | src/examples/_6_generics.rs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/examples/_6_generics.rs b/src/examples/_6_generics.rs index 82ecdf99..22bb777a 100644 --- a/src/examples/_6_generics.rs +++ b/src/examples/_6_generics.rs @@ -2,6 +2,7 @@ //! //! ``` //! #![deny(unsafe_code)] +//! #![deny(warnings)] //! #![feature(proc_macro)] //! #![no_std] //! @@ -14,6 +15,11 @@ //! app! { //! device: stm32f103xx, //! +//! resources: { +//! static GPIOA: GPIOA; +//! static SPI1: SPI1; +//! }, +//! //! tasks: { //! EXTI0: { //! path: exti0, @@ -29,7 +35,12 @@ //! }, //! } //! -//! fn init(_p: init::Peripherals) {} +//! fn init(p: init::Peripherals) -> init::LateResources { +//! init::LateResources { +//! GPIOA: p.device.GPIOA, +//! SPI1: p.device.SPI1, +//! } +//! } //! //! fn idle() -> ! { //! loop { @@ -61,7 +72,7 @@ //! //! // This task has direct access to the resources //! fn exti1(t: &mut Threshold, r: EXTI1::Resources) { -//! work(t, r.GPIOA, r.SPI1); +//! work(t, &r.GPIOA, &r.SPI1); //! } //! ``` // Auto-generated. Do not modify. |