Skip to content
Snippets Groups Projects
Commit 92d9eced authored by Federico Lolli's avatar Federico Lolli
Browse files

Reintroduced timing issue fix (with heavy load)

parent 7cf41b41
Branches
Tags
No related merge requests found
......@@ -67,9 +67,13 @@ impl SerialManager {
let mut buf = vec![0; n];
// implement a read exact to allow better error messages
let mut filled = 0;
let timeout = Instant::now() + port.read_timeout;
while filled < n {
match port.reader_ch.as_ref().unwrap().recv_deadline(timeout) {
match port
.reader_ch
.as_ref()
.unwrap()
.recv_timeout(port.read_timeout)
{
Ok(b) => {
buf[filled] = b;
filled += 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment