diff options
Diffstat (limited to 'embassy-rp/src/pio_programs/onewire.rs')
| -rw-r--r-- | embassy-rp/src/pio_programs/onewire.rs | 8 |
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 | ||
| 3 | use crate::Peri; | ||
| 3 | use crate::clocks::clk_sys_freq; | 4 | use crate::clocks::clk_sys_freq; |
| 4 | use crate::gpio::Level; | 5 | use crate::gpio::Level; |
| 5 | use crate::pio::{ | 6 | use crate::pio::{ |
| 6 | Common, Config, Direction, Instance, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, StateMachine, | 7 | Common, Config, Direction, Instance, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, StateMachine, |
| 7 | }; | 8 | }; |
| 8 | use crate::Peri; | ||
| 9 | 9 | ||
| 10 | /// This struct represents a onewire driver program | 10 | /// This struct represents a onewire driver program |
| 11 | pub struct PioOneWireProgram<'a, PIO: Instance> { | 11 | pub 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 |
