diff options
| -rw-r--r-- | embassy-rp/src/uart/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/embassy-rp/src/uart/mod.rs b/embassy-rp/src/uart/mod.rs index a9ae6c3f4..9f5ba4e8a 100644 --- a/embassy-rp/src/uart/mod.rs +++ b/embassy-rp/src/uart/mod.rs | |||
| @@ -125,6 +125,7 @@ pub enum Error { | |||
| 125 | pub enum ReadToBreakError { | 125 | pub enum ReadToBreakError { |
| 126 | /// Read this many bytes, but never received a line break. | 126 | /// Read this many bytes, but never received a line break. |
| 127 | MissingBreak(usize), | 127 | MissingBreak(usize), |
| 128 | /// Other, standard issue with the serial request | ||
| 128 | Other(Error), | 129 | Other(Error), |
| 129 | } | 130 | } |
| 130 | 131 | ||
| @@ -936,6 +937,9 @@ impl<'d, T: Instance> Uart<'d, T, Async> { | |||
| 936 | self.rx.read(buffer).await | 937 | self.rx.read(buffer).await |
| 937 | } | 938 | } |
| 938 | 939 | ||
| 940 | /// Read until the buffer is full or a line break occurs. | ||
| 941 | /// | ||
| 942 | /// See [`UartRx::read_to_break()`] for more details | ||
| 939 | pub async fn read_to_break<'a>(&mut self, buf: &'a mut [u8]) -> Result<usize, ReadToBreakError> { | 943 | pub async fn read_to_break<'a>(&mut self, buf: &'a mut [u8]) -> Result<usize, ReadToBreakError> { |
| 940 | self.rx.read_to_break(buf).await | 944 | self.rx.read_to_break(buf).await |
| 941 | } | 945 | } |
