]> sigrok.org Git - libsigrok.git/commitdiff
rigol-ds: Use correct digital channel numbers when fetching config.
authorMartin Ling <redacted>
Tue, 14 Jan 2014 18:25:08 +0000 (18:25 +0000)
committerMartin Ling <redacted>
Tue, 14 Jan 2014 18:28:19 +0000 (18:28 +0000)
hardware/rigol-ds/protocol.c

index 9952e2a41517b0865e0b458ea3a324002e25d80f..5ede6d7cab562e081226d65b622bca38a54c2f40 100644 (file)
@@ -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");
                }
        }