Skip to content

Commit

Permalink
format: run cargo xtask fmt-packages
Browse files Browse the repository at this point in the history
  • Loading branch information
zpg6 committed Dec 21, 2024
1 parent 3d14724 commit be1a908
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions esp-hal/src/uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -973,10 +973,16 @@ where
}

/// Busy waits for a break condition to be detected on the RX line.
/// Condition is met when the receiver detects a NULL character (i.e. logic 0 for one NULL
/// character transmission) after stop bits.
/// Condition is met when the receiver detects a NULL character (i.e. logic
/// 0 for one NULL character transmission) after stop bits.
pub fn wait_for_break(&mut self) {
while !self.register_block().int_raw().read().brk_det().bit_is_set() {
while !self
.register_block()
.int_raw()
.read()
.brk_det()
.bit_is_set()
{
// Just busy waiting
}
}
Expand Down Expand Up @@ -1167,8 +1173,8 @@ pub enum UartInterrupt {
TxDone,

/// Break condition has been detected.
/// Triggered when the receiver detects a NULL character (i.e. logic 0 for one NULL
/// character transmission) after stop bits.
/// Triggered when the receiver detects a NULL character (i.e. logic 0 for
/// one NULL character transmission) after stop bits.
RxBreakDetected,

/// The receiver has received more data than what
Expand Down Expand Up @@ -1937,7 +1943,10 @@ where
RxEvent::GlitchDetected => return Err(Error::RxGlitchDetected),
RxEvent::FrameError => return Err(Error::RxFrameError),
RxEvent::ParityError => return Err(Error::RxParityError),
RxEvent::FifoFull | RxEvent::CmdCharDetected | RxEvent::BreakDetected | RxEvent::FifoTout => continue,
RxEvent::FifoFull
| RxEvent::CmdCharDetected
| RxEvent::BreakDetected
| RxEvent::FifoTout => continue,
}
}
// Unfortunately, the uart's rx-timeout counter counts up whenever there is
Expand All @@ -1955,8 +1964,8 @@ where
}

/// Interrupt-driven wait for a break condition on the RX line.
/// Condition is met when the receiver detects a NULL character (i.e. logic 0 for one NULL
/// character transmission) after stop bits.
/// Condition is met when the receiver detects a NULL character (i.e. logic
/// 0 for one NULL character transmission) after stop bits.
pub async fn wait_for_break_async(&mut self) -> Result<(), Error> {
UartRxFuture::new(self.uart.reborrow(), RxEvent::BreakDetected).await;
Ok(())
Expand Down

0 comments on commit be1a908

Please sign in to comment.