From: Martin Ling Date: Tue, 14 Jan 2014 18:25:08 +0000 (+0000) Subject: rigol-ds: Use correct digital channel numbers when fetching config. X-Git-Tag: libsigrok-0.3.0~296 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=bfaf112b689cba3ae5b3a73133fcdf7e45653550;p=libsigrok.git rigol-ds: Use correct digital channel numbers when fetching config. --- diff --git a/hardware/rigol-ds/protocol.c b/hardware/rigol-ds/protocol.c index 9952e2a4..5ede6d7c 100644 --- a/hardware/rigol-ds/protocol.c +++ b/hardware/rigol-ds/protocol.c @@ -702,14 +702,14 @@ SR_PRIV int rigol_ds_get_dev_cfg(const struct sr_dev_inst *sdi) if (devc->model->has_digital) { sr_dbg("Current digital channel state:"); for (i = 0; i < 16; i++) { - cmd = g_strdup_printf(":DIG%d:TURN?", i + 1); + cmd = g_strdup_printf(":DIG%d:TURN?", i); res = get_cfg_string(sdi, cmd, &t_s); g_free(cmd); if (res != SR_OK) return SR_ERR; devc->digital_channels[i] = !strcmp(t_s, "ON") ? TRUE : FALSE; g_free(t_s); - sr_dbg("D%d: %s", i + 1, devc->digital_channels[i] ? "on" : "off"); + sr_dbg("D%d: %s", i, devc->digital_channels[i] ? "on" : "off"); } }