Skip to content
Snippets Groups Projects
Commit 7a1b349d authored by Stephen D's avatar Stephen D
Browse files

add some uart flushes

parent e3caaf54
No related branches found
No related tags found
No related merge requests found
......@@ -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)?;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment