]> sigrok.org Git - libsigrok.git/commitdiff
agilent-dmm: fix handling of AC/DC flags in volts mode
authorAurelien Jacobs <redacted>
Sat, 11 Jun 2016 23:41:26 +0000 (01:41 +0200)
committerAurelien Jacobs <redacted>
Sun, 26 Jun 2016 18:32:56 +0000 (20:32 +0200)
src/hardware/agilent-dmm/sched.c

index a7c8a8e1c413c93986ebda1dd157f175fc1d7405..e361f13b1d5cc0ed4b81ce002b853ed1c55f1f1f 100644 (file)
@@ -449,18 +449,16 @@ static int recv_conf_u124x_5x(const struct sr_dev_inst *sdi, GMatchInfo *match)
                devc->cur_mqflags = 0;
                devc->cur_exponent = 0;
                if (mstr[4] == ':') {
-                       if (!strncmp(mstr + 5, "AC", 2)) {
+                       if (!strncmp(mstr + 5, "ACDC", 4)) {
+                               /* AC + DC offset */
+                               devc->cur_mqflags |= SR_MQFLAG_AC | SR_MQFLAG_DC | SR_MQFLAG_RMS;
+                       } else if (!strncmp(mstr + 5, "AC", 2)) {
                                devc->cur_mqflags |= SR_MQFLAG_AC | SR_MQFLAG_RMS;
                        } else if (!strncmp(mstr + 5, "DC", 2)) {
                                devc->cur_mqflags |= SR_MQFLAG_DC;
-                       } else if (!strncmp(mstr + 5, "ACDC", 4)) {
-                               /* AC + DC offset */
-                               devc->cur_mqflags |= SR_MQFLAG_AC | SR_MQFLAG_DC | SR_MQFLAG_RMS;
-                       } else {
-                               devc->cur_mqflags &= ~(SR_MQFLAG_AC | SR_MQFLAG_DC);
                        }
                } else
-                       devc->cur_mqflags &= ~(SR_MQFLAG_AC | SR_MQFLAG_DC);
+                       devc->cur_mqflags |= SR_MQFLAG_DC;
        } else if (!strcmp(mstr, "CURR")) {
                devc->cur_mq = SR_MQ_CURRENT;
                devc->cur_unit = SR_UNIT_AMPERE;