This code implements its own waiting based on baudrate, so the read itself
should be nonblocking. In general it will have been already, since drivers
almost universally use the SERIAL_NONBLOCK flag.
i = ibuf = len = 0;
while (ibuf < maxlen) {
i = ibuf = len = 0;
while (ibuf < maxlen) {
- len = serial_read(serial, &buf[ibuf], 1);
+ len = serial_read_nonblocking(serial, &buf[ibuf], 1);
if (len > 0) {
ibuf += len;
} else if (len == 0) {
if (len > 0) {
ibuf += len;
} else if (len == 0) {