diff --git a/src/radio.rs b/src/radio.rs index af28180d8e0195d52dcb0de0b1a8acd2161df1ba..101af05204c1050fbeed6aa9e15acf32ee2e5120 100644 --- a/src/radio.rs +++ b/src/radio.rs @@ -28,6 +28,7 @@ impl UartRadio { pub fn send_packet(&mut self, packet: &FecPacket) -> anyhow::Result<()> { self.uart.write_all(&[SEND_PACKET_CMD])?; self.uart.write_all(&packet.0)?; + self.uart.flush()?; let mut buf = [0; 1]; self.uart.read_exact(&mut buf)?; @@ -48,6 +49,7 @@ impl UartRadio { pub fn get_temp(&mut self) -> anyhow::Result<f32> { self.uart.write_all(&[GET_TEMP_CMD])?; + self.uart.flush()?; let mut buf = [0; 4]; self.uart.read_exact(&mut buf)?;