From e85d6e53c89cd1ea1da8826778c5a74154fb651d Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 27 Jul 2017 22:40:47 -0500 Subject: update examples --- src/examples/_5_generics.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/examples/_5_generics.rs') diff --git a/src/examples/_5_generics.rs b/src/examples/_5_generics.rs index a8f42cd..82ecdf9 100644 --- a/src/examples/_5_generics.rs +++ b/src/examples/_5_generics.rs @@ -1,12 +1,10 @@ //! Working with resources in a generic fashion //! //! ``` -//! //! #![deny(unsafe_code)] //! #![feature(proc_macro)] //! #![no_std] //! -//! #[macro_use(task)] //! extern crate cortex_m_rtfm as rtfm; //! extern crate stm32f103xx; //! @@ -18,13 +16,13 @@ //! //! tasks: { //! EXTI0: { -//! enabled: true, +//! path: exti0, //! priority: 1, //! resources: [GPIOA, SPI1], //! }, //! //! EXTI1: { -//! enabled: true, +//! path: exti1, //! priority: 2, //! resources: [GPIOA, SPI1], //! }, @@ -39,7 +37,7 @@ //! } //! } //! -//! // a generic function to use resources in any task (regardless of its priority) +//! // A generic function that uses some resources //! fn work(t: &mut Threshold, gpioa: &G, spi1: &S) //! where //! G: Resource, @@ -56,16 +54,12 @@ //! }); //! } //! -//! task!(EXTI0, exti0); -//! -//! // this task needs critical sections to access the resources +//! // This task needs critical sections to access the resources //! fn exti0(t: &mut Threshold, r: EXTI0::Resources) { //! work(t, &r.GPIOA, &r.SPI1); //! } //! -//! task!(EXTI1, exti1); -//! -//! // this task has direct access to the resources +//! // This task has direct access to the resources //! fn exti1(t: &mut Threshold, r: EXTI1::Resources) { //! work(t, r.GPIOA, r.SPI1); //! } -- cgit v1.2.3