diff options
| author | Andres Vahter <[email protected]> | 2024-01-19 19:58:00 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2024-01-20 00:15:40 +0100 |
| commit | 534c53c901345f8af517b8991a4bcd99d290c11c (patch) | |
| tree | 720833608d492e01e76435ca8cc952650e99f9b5 | |
| parent | c936d66934225db8ddd283d7da2d7a158686df71 (diff) | |
stm32 uart: remove unwrap
unwraps take more space because of panics
| -rw-r--r-- | embassy-stm32/src/usart/buffered.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/embassy-stm32/src/usart/buffered.rs b/embassy-stm32/src/usart/buffered.rs index 52740c13e..abc766bc7 100644 --- a/embassy-stm32/src/usart/buffered.rs +++ b/embassy-stm32/src/usart/buffered.rs | |||
| @@ -47,8 +47,10 @@ impl<T: BasicInstance> interrupt::typelevel::Handler<T::Interrupt> for Interrupt | |||
| 47 | let mut rx_writer = state.rx_buf.writer(); | 47 | let mut rx_writer = state.rx_buf.writer(); |
| 48 | let buf = rx_writer.push_slice(); | 48 | let buf = rx_writer.push_slice(); |
| 49 | if !buf.is_empty() { | 49 | if !buf.is_empty() { |
| 50 | buf[0] = dr.unwrap(); | 50 | if let Some(byte) = dr { |
| 51 | rx_writer.push_done(1); | 51 | buf[0] = byte; |
| 52 | rx_writer.push_done(1); | ||
| 53 | } | ||
| 52 | } else { | 54 | } else { |
| 53 | // FIXME: Should we disable any further RX interrupts when the buffer becomes full. | 55 | // FIXME: Should we disable any further RX interrupts when the buffer becomes full. |
| 54 | } | 56 | } |
