diff options
Diffstat (limited to 'examples/generics.rs')
-rw-r--r-- | examples/generics.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/generics.rs b/examples/generics.rs index 6c6e1d6e..57c9b8eb 100644 --- a/examples/generics.rs +++ b/examples/generics.rs @@ -1,5 +1,4 @@ //! Working with resources in a generic fashion - #![deny(unsafe_code)] #![feature(proc_macro)] #![no_std] @@ -36,7 +35,7 @@ fn idle() -> ! { } } -// a generic function to use resources in any task (regardless of its priority) +// A generic function that uses some resources fn work<G, S>(t: &mut Threshold, gpioa: &G, spi1: &S) where G: Resource<Data = GPIOA>, @@ -53,12 +52,12 @@ where }); } -// 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); } -// 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); } |