From f0c750422970db71304101fca821a0c254571604 Mon Sep 17 00:00:00 2001 From: "Jomer.Dev" Date: Mon, 8 Jan 2024 00:21:22 +0100 Subject: [PATCH] Fix log messages not always showing up straight away --- embassy-usb-logger/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/embassy-usb-logger/src/lib.rs b/embassy-usb-logger/src/lib.rs index 422cefb59..5142d9073 100644 --- a/embassy-usb-logger/src/lib.rs +++ b/embassy-usb-logger/src/lib.rs @@ -93,6 +93,9 @@ impl UsbLogger { loop { let len = self.buffer.read(&mut rx[..]).await; let _ = sender.write_packet(&rx[..len]).await; + if len as u8 == MAX_PACKET_SIZE { + let _ = sender.write_packet(&[]).await; + } } }; let discard_fut = async { @@ -121,6 +124,9 @@ impl UsbLogger { loop { let len = self.buffer.read(&mut rx[..]).await; let _ = sender.write_packet(&rx[..len]).await; + if len as u8 == MAX_PACKET_SIZE { + let _ = sender.write_packet(&[]).await; + } } }; let discard_fut = async {