mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-21 22:32:29 +00:00
Fix log messages not always showing up straight away
This commit is contained in:
parent
6f505feeb1
commit
f0c7504229
@ -93,6 +93,9 @@ impl<const N: usize> UsbLogger<N> {
|
|||||||
loop {
|
loop {
|
||||||
let len = self.buffer.read(&mut rx[..]).await;
|
let len = self.buffer.read(&mut rx[..]).await;
|
||||||
let _ = sender.write_packet(&rx[..len]).await;
|
let _ = sender.write_packet(&rx[..len]).await;
|
||||||
|
if len as u8 == MAX_PACKET_SIZE {
|
||||||
|
let _ = sender.write_packet(&[]).await;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let discard_fut = async {
|
let discard_fut = async {
|
||||||
@ -121,6 +124,9 @@ impl<const N: usize> UsbLogger<N> {
|
|||||||
loop {
|
loop {
|
||||||
let len = self.buffer.read(&mut rx[..]).await;
|
let len = self.buffer.read(&mut rx[..]).await;
|
||||||
let _ = sender.write_packet(&rx[..len]).await;
|
let _ = sender.write_packet(&rx[..len]).await;
|
||||||
|
if len as u8 == MAX_PACKET_SIZE {
|
||||||
|
let _ = sender.write_packet(&[]).await;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let discard_fut = async {
|
let discard_fut = async {
|
||||||
|
Loading…
Reference in New Issue
Block a user