From: Aurelien Jacobs Date: Sat, 11 Jun 2016 23:41:26 +0000 (+0200) Subject: agilent-dmm: fix handling of AC/DC flags in volts mode X-Git-Tag: libsigrok-0.5.0~293 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=96ed86253b1d320b8f467581d7a29b9e4a570348;p=libsigrok.git agilent-dmm: fix handling of AC/DC flags in volts mode --- diff --git a/src/hardware/agilent-dmm/sched.c b/src/hardware/agilent-dmm/sched.c index a7c8a8e1..e361f13b 100644 --- a/src/hardware/agilent-dmm/sched.c +++ b/src/hardware/agilent-dmm/sched.c @@ -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;