From 96ed86253b1d320b8f467581d7a29b9e4a570348 Mon Sep 17 00:00:00 2001 From: Aurelien Jacobs Date: Sun, 12 Jun 2016 01:41:26 +0200 Subject: [PATCH] agilent-dmm: fix handling of AC/DC flags in volts mode --- src/hardware/agilent-dmm/sched.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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;