]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/motech-lps-30x/protocol.c
Various #include file cosmetic fixes.
[libsigrok.git] / src / hardware / motech-lps-30x / protocol.c
index c4afd657a730becdc1a26ede17917b35a193b9a5..db69eb5f32f93c387f178e4a7889a11aaaee3f7b 100644 (file)
@@ -25,7 +25,6 @@
 
 #include <errno.h>
 #include <string.h>
-
 #include "protocol.h"
 
 /** Send data packets for current measurements. */
@@ -77,7 +76,10 @@ static void process_line(struct sr_dev_inst *sdi)
        case 1: /* Waiting for data reply to request */
                /* Convert numbers */
                switch (devc->acq_req) {
-               case AQ_U1:  case AQ_U2:  case AQ_I1:  case AQ_I2:
+               case AQ_U1:
+               case AQ_U2:
+               case AQ_I1:
+               case AQ_I2:
                        if (sr_atod(devc->buf, &dbl) != SR_OK) {
                                sr_err("Failed to convert '%s' to double, errno=%d %s",
                                        devc->buf, errno, strerror(errno));
@@ -131,7 +133,6 @@ static void process_line(struct sr_dev_inst *sdi)
        devc->buflen = 0;
 }
 
-
 SR_PRIV int motech_lps_30x_receive_data(int fd, int revents, void *cb_data)
 {
        struct sr_dev_inst *sdi;
@@ -152,7 +153,7 @@ SR_PRIV int motech_lps_30x_receive_data(int fd, int revents, void *cb_data)
 
        if (revents == G_IO_IN) { /* Serial data arrived. */
                while (LINELEN_MAX - devc->buflen - 2 > 0) {
-                       len = serial_read(serial, devc->buf + devc->buflen, 1);
+                       len = serial_read_nonblocking(serial, devc->buf + devc->buflen, 1);
                        if (len < 1)
                                break;
 
@@ -197,8 +198,7 @@ SR_PRIV int motech_lps_30x_receive_data(int fd, int revents, void *cb_data)
                        }
                }
                if (devc->acq_req_pending == 0) {
-                       switch(devc->acq_req)
-                       {
+                       switch (devc->acq_req) {
                        case AQ_NONE: /* Fall through */
                        case AQ_STATUS:
                                devc->acq_req = AQ_U1;