diff options
| -rw-r--r-- | examples/rp/src/bin/blinky_two_tasks.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/rp/src/bin/blinky_two_tasks.rs b/examples/rp/src/bin/blinky_two_tasks.rs index 6b4d35165..7e0b531e1 100644 --- a/examples/rp/src/bin/blinky_two_tasks.rs +++ b/examples/rp/src/bin/blinky_two_tasks.rs | |||
| @@ -7,14 +7,14 @@ | |||
| 7 | /// [Link explaining it](https://www.physicsclassroom.com/class/sound/Lesson-3/Interference-and-Beats) | 7 | /// [Link explaining it](https://www.physicsclassroom.com/class/sound/Lesson-3/Interference-and-Beats) |
| 8 | use defmt::*; | 8 | use defmt::*; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_rp::{gpio, PeripheralRef}; | 10 | use embassy_rp::gpio; |
| 11 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; | 11 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; |
| 12 | use embassy_sync::mutex::Mutex; | 12 | use embassy_sync::mutex::Mutex; |
| 13 | use embassy_time::{Duration, Ticker}; | 13 | use embassy_time::{Duration, Ticker}; |
| 14 | use gpio::{AnyPin, Level, Output}; | 14 | use gpio::{AnyPin, Level, Output}; |
| 15 | use {defmt_rtt as _, panic_probe as _}; | 15 | use {defmt_rtt as _, panic_probe as _}; |
| 16 | 16 | ||
| 17 | type LedType = Mutex<ThreadModeRawMutex, Option<PeripheralRef<'static, Output<'static, AnyPin>>>>; | 17 | type LedType = Mutex<ThreadModeRawMutex, Option<Output<'static, AnyPin>>>; |
| 18 | static LED: LedType = Mutex::new(None); | 18 | static LED: LedType = Mutex::new(None); |
| 19 | 19 | ||
| 20 | #[embassy_executor::main] | 20 | #[embassy_executor::main] |
| @@ -25,7 +25,7 @@ async fn main(spawner: Spawner) { | |||
| 25 | // inner scope is so that once the mutex is written to, the MutexGuard is dropped, thus the | 25 | // inner scope is so that once the mutex is written to, the MutexGuard is dropped, thus the |
| 26 | // Mutex is released | 26 | // Mutex is released |
| 27 | { | 27 | { |
| 28 | *(LED.lock().await) = Some(PeripheralRef::new(led)); | 28 | *(LED.lock().await) = Some(led); |
| 29 | } | 29 | } |
| 30 | let dt = 100 * 1_000_000; | 30 | let dt = 100 * 1_000_000; |
| 31 | let k = 1.003; | 31 | let k = 1.003; |
