aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/rp/src/bin/blinky_two_tasks.rs6
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)
8use defmt::*; 8use defmt::*;
9use embassy_executor::Spawner; 9use embassy_executor::Spawner;
10use embassy_rp::{gpio, PeripheralRef}; 10use embassy_rp::gpio;
11use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; 11use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex;
12use embassy_sync::mutex::Mutex; 12use embassy_sync::mutex::Mutex;
13use embassy_time::{Duration, Ticker}; 13use embassy_time::{Duration, Ticker};
14use gpio::{AnyPin, Level, Output}; 14use gpio::{AnyPin, Level, Output};
15use {defmt_rtt as _, panic_probe as _}; 15use {defmt_rtt as _, panic_probe as _};
16 16
17type LedType = Mutex<ThreadModeRawMutex, Option<PeripheralRef<'static, Output<'static, AnyPin>>>>; 17type LedType = Mutex<ThreadModeRawMutex, Option<Output<'static, AnyPin>>>;
18static LED: LedType = Mutex::new(None); 18static 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;