mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-01-11 04:51:31 +11:00
parent
05e072025d
commit
de53600199
|
@ -116,9 +116,13 @@ fn main() -> ! {
|
|||
// Send back to the host
|
||||
let mut wr_ptr = &buf[..count];
|
||||
while !wr_ptr.is_empty() {
|
||||
let _ = serial.write(wr_ptr).map(|len| {
|
||||
wr_ptr = &wr_ptr[len..];
|
||||
});
|
||||
match serial.write(wr_ptr) {
|
||||
Ok(len) => wr_ptr = &wr_ptr[len..],
|
||||
// On error, just drop unwritten data.
|
||||
// One possible error is Err(WouldBlock), meaning the USB
|
||||
// write buffer is full.
|
||||
Err(_) => break,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue