aboutsummaryrefslogtreecommitdiff
path: root/embassy-rp/src/pio_programs/onewire.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-rp/src/pio_programs/onewire.rs')
-rw-r--r--embassy-rp/src/pio_programs/onewire.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/embassy-rp/src/pio_programs/onewire.rs b/embassy-rp/src/pio_programs/onewire.rs
index 980d0fe5f..09babc229 100644
--- a/embassy-rp/src/pio_programs/onewire.rs
+++ b/embassy-rp/src/pio_programs/onewire.rs
@@ -1,11 +1,11 @@
1//! OneWire pio driver 1//! OneWire pio driver
2 2
3use crate::Peri;
3use crate::clocks::clk_sys_freq; 4use crate::clocks::clk_sys_freq;
4use crate::gpio::Level; 5use crate::gpio::Level;
5use crate::pio::{ 6use crate::pio::{
6 Common, Config, Direction, Instance, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, StateMachine, 7 Common, Config, Direction, Instance, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, StateMachine,
7}; 8};
8use crate::Peri;
9 9
10/// This struct represents a onewire driver program 10/// This struct represents a onewire driver program
11pub struct PioOneWireProgram<'a, PIO: Instance> { 11pub struct PioOneWireProgram<'a, PIO: Instance> {
@@ -321,11 +321,7 @@ impl PioOneWireSearch {
321 321
322 /// Search for the next address on the bus 322 /// Search for the next address on the bus
323 pub async fn next<PIO: Instance, const SM: usize>(&mut self, pio: &mut PioOneWire<'_, PIO, SM>) -> Option<u64> { 323 pub async fn next<PIO: Instance, const SM: usize>(&mut self, pio: &mut PioOneWire<'_, PIO, SM>) -> Option<u64> {
324 if self.finished { 324 if self.finished { None } else { pio.search(self).await }
325 None
326 } else {
327 pio.search(self).await
328 }
329 } 325 }
330 326
331 /// Is finished when all devices have been found 327 /// Is finished when all devices have been found