diff options
author | 2017-07-27 22:40:47 -0500 | |
---|---|---|
committer | 2017-07-27 22:40:47 -0500 | |
commit | e85d6e53c89cd1ea1da8826778c5a74154fb651d (patch) | |
tree | 76fbc30063df22724b9b160c85055e1d294513b0 /examples/generics.rs | |
parent | 271df39bdba0690ea7ba77a6ff5d8d7edb9b8036 (diff) | |
download | rtic-e85d6e53c89cd1ea1da8826778c5a74154fb651d.tar.gz rtic-e85d6e53c89cd1ea1da8826778c5a74154fb651d.tar.zst rtic-e85d6e53c89cd1ea1da8826778c5a74154fb651d.zip |
update examples
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); } |