From 388eee221e16717fe47913d26a1f6ed4cd35d4bc Mon Sep 17 00:00:00 2001 From: Matt Bhagat-Conway Date: Thu, 3 Jul 2025 10:31:28 -0400 Subject: add note about UART line breaks being different from ASCII --- embassy-rp/src/uart/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/embassy-rp/src/uart/mod.rs b/embassy-rp/src/uart/mod.rs index c3a15fda5..b730d33e3 100644 --- a/embassy-rp/src/uart/mod.rs +++ b/embassy-rp/src/uart/mod.rs @@ -515,6 +515,9 @@ impl<'d> UartRx<'d, Async> { /// * If you expect a message of 20 bytes + line break, and provide a 21-byte buffer: /// * The first call to `read_to_break()` will return `Ok(20)`. /// * The next call to `read_to_break()` will work as expected + /// + /// **NOTE**: In the UART context, a line break refers to a break condition (the line being held low for + /// for longer than a single character), not an ASCII line break. pub async fn read_to_break(&mut self, buffer: &mut [u8]) -> Result { self.read_to_break_with_count(buffer, 0).await } @@ -541,6 +544,9 @@ impl<'d> UartRx<'d, Async> { /// * If you expect a message of 20 bytes + line break, and provide a 21-byte buffer: /// * The first call to `read_to_break()` will return `Ok(20)`. /// * The next call to `read_to_break()` will work as expected + /// + /// **NOTE**: In the UART context, a line break refers to a break condition (the line being held low for + /// for longer than a single character), not an ASCII line break. pub async fn read_to_break_with_count( &mut self, buffer: &mut [u8], -- cgit