stm32 uart: remove unwrap
unwraps take more space because of panics
This commit is contained in:
parent
c936d66934
commit
534c53c901
1 changed files with 4 additions and 2 deletions
|
@ -47,8 +47,10 @@ impl<T: BasicInstance> interrupt::typelevel::Handler<T::Interrupt> for Interrupt
|
||||||
let mut rx_writer = state.rx_buf.writer();
|
let mut rx_writer = state.rx_buf.writer();
|
||||||
let buf = rx_writer.push_slice();
|
let buf = rx_writer.push_slice();
|
||||||
if !buf.is_empty() {
|
if !buf.is_empty() {
|
||||||
buf[0] = dr.unwrap();
|
if let Some(byte) = dr {
|
||||||
rx_writer.push_done(1);
|
buf[0] = byte;
|
||||||
|
rx_writer.push_done(1);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// FIXME: Should we disable any further RX interrupts when the buffer becomes full.
|
// FIXME: Should we disable any further RX interrupts when the buffer becomes full.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue