X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fgmc-mh-1x-2x%2Fprotocol.c;h=7d06b07176fbfb0d52423460adbb9c026e91d6f7;hb=8ebad343709aad6ef4d5aa83a2633690ef313de5;hp=53efdf4255f7500d60c4f07ef36ac6e537f4dff3;hpb=ca314e060f653e6a0b5ec0f58914bac4d426217f;p=libsigrok.git diff --git a/src/hardware/gmc-mh-1x-2x/protocol.c b/src/hardware/gmc-mh-1x-2x/protocol.c index 53efdf42..7d06b071 100644 --- a/src/hardware/gmc-mh-1x-2x/protocol.c +++ b/src/hardware/gmc-mh-1x-2x/protocol.c @@ -755,8 +755,7 @@ static void process_msg_inf_10(struct sr_dev_inst *sdi) dgt = bc(devc->buf[5 + cnt]); if (dgt == 11) { /* Empty digit */ dgt = 0; - } - else if (dgt >= 12) { /* Overload */ + } else if (dgt >= 12) { /* Overload */ devc->value = NAN; devc->scale = 0; break; @@ -953,8 +952,7 @@ static int chk_msg14(struct sr_dev_inst *sdi) sr_err("Device: Unknown error code!"); } retc = SR_ERR_ARG; - } - else if (!isreq && ((devc->buf[1] != 0x27) || (devc->buf[2] != 0x3f))) { + } else if (!isreq && ((devc->buf[1] != 0x27) || (devc->buf[2] != 0x3f))) { sr_err("process_msg_14(): byte 1/2 unexpected!"); retc = SR_ERR_ARG; } @@ -1055,11 +1053,9 @@ SR_PRIV int process_msg14(struct sr_dev_inst *sdi) devc->value = NAN; devc->scale = 0; break; - } - else if (dgt == 13) { /* FUSE */ + } else if (dgt == 13) { /* FUSE */ sr_err("FUSE!"); - } - else if (dgt == 14) { /* Function recognition mode, OPEN */ + } else if (dgt == 14) { /* Function recognition mode, OPEN */ sr_info("Function recognition mode, OPEN!"); devc->value = NAN; devc->scale = 0; @@ -1135,8 +1131,7 @@ SR_PRIV int gmc_mh_1x_2x_receive_data(int fd, int revents, void *cb_data) process_msg_inf_10(sdi); devc->buflen = 0; continue; - } - else if ((devc->buflen >= 5) && + } else if ((devc->buflen >= 5) && (devc->buf[devc->buflen - 1] & MSGID_MASK) != MSGID_DATA) { /* @@ -1144,8 +1139,7 @@ SR_PRIV int gmc_mh_1x_2x_receive_data(int fd, int revents, void *cb_data) * of next message. */ process_msg_inf_5(sdi); - devc->buf[0] = - devc->buf[devc->buflen - 1]; + devc->buf[0] = devc->buf[devc->buflen - 1]; devc->buflen = 1; continue; } @@ -1223,8 +1217,7 @@ SR_PRIV int gmc_mh_2x_receive_data(int fd, int revents, void *cb_data) if (devc->cmd_seq % 10 == 0) { if (req_stat14(sdi, FALSE) != SR_OK) return FALSE; - } - else if (req_meas14(sdi) != SR_OK) + } else if (req_meas14(sdi) != SR_OK) return FALSE; } }