From: Martin Ling Date: Tue, 16 Sep 2014 01:42:26 +0000 (+0100) Subject: brymen-dmm: Mark serial read calls as nonblocking. X-Git-Tag: libsigrok-0.4.0~972 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=44be13b1f8dfa67345585af8018b60c17c01025d;p=libsigrok.git brymen-dmm: Mark serial read calls as nonblocking. The driver opens the port with SERIAL_NONBLOCK so these were already nonblocking, and are handled appropriately. --- diff --git a/src/hardware/brymen-dmm/protocol.c b/src/hardware/brymen-dmm/protocol.c index dff7b985..881881cf 100644 --- a/src/hardware/brymen-dmm/protocol.c +++ b/src/hardware/brymen-dmm/protocol.c @@ -57,7 +57,7 @@ static void handle_new_data(struct sr_dev_inst *sdi) /* Try to get as much data as the buffer can hold. */ 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 < 1) { sr_err("Serial port read error: %d.", len); return; @@ -192,7 +192,7 @@ SR_PRIV int brymen_stream_detect(struct sr_serial_dev_inst *serial, packet_len = i = ibuf = len = 0; while (ibuf < maxlen) { - len = serial_read(serial, &buf[ibuf], maxlen - ibuf); + len = serial_read_nonblocking(serial, &buf[ibuf], maxlen - ibuf); if (len > 0) { ibuf += len; sr_spew("Read %d bytes.", len);