serial-dmm: Mark serial read/write calls as nonblocking.
This driver opens the port with the SERIAL_NONBLOCK flag so these calls were already non-blocking.
This commit is contained in:
parent
02bd1d0298
commit
4277ac349c
|
@ -283,7 +283,7 @@ SR_PRIV int sr_metex14_packet_request(struct sr_serial_dev_inst *serial)
|
||||||
|
|
||||||
sr_spew("Requesting DMM packet.");
|
sr_spew("Requesting DMM packet.");
|
||||||
|
|
||||||
return (serial_write(serial, &wbuf, 1) == 1) ? SR_OK : SR_ERR;
|
return (serial_write_nonblocking(serial, &wbuf, 1) == 1) ? SR_OK : SR_ERR;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ static void handle_new_data(struct sr_dev_inst *sdi, int dmm, void *info)
|
||||||
|
|
||||||
/* Try to get as much data as the buffer can hold. */
|
/* Try to get as much data as the buffer can hold. */
|
||||||
len = DMM_BUFSIZE - devc->buflen;
|
len = DMM_BUFSIZE - devc->buflen;
|
||||||
len = serial_read(serial, devc->buf + devc->buflen, len);
|
len = serial_read_nonblocking(serial, devc->buf + devc->buflen, len);
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
return; /* No new bytes, nothing to do. */
|
return; /* No new bytes, nothing to do. */
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
|
|
Loading…
Reference in New Issue