]> sigrok.org Git - libsigrok.git/commitdiff
rigol-ds: Fix crash when fetching logic channels
authorStefan Brüns <redacted>
Mon, 11 Dec 2017 03:17:26 +0000 (04:17 +0100)
committerUwe Hermann <redacted>
Tue, 26 Dec 2017 18:21:42 +0000 (19:21 +0100)
When refactoring the code, some places where sr_scpi_send was replaced
by rigol_ds_config_set the first argument was not changed from sdi->conn
to sdi. Fix the remaining ones.

Fix: https://sigrok.org/bug/1073

Signed-off-by: Stefan Brüns <redacted>
src/hardware/rigol-ds/protocol.c

index 833104e890ddac4c74645a474b1a9077a011ffee..d21008b66b0586a8c8a6e6802ca98f0dc660f43d 100644 (file)
@@ -221,7 +221,7 @@ static int rigol_ds_check_stop(const struct sr_dev_inst *sdi)
                return SR_OK;
 
        if (ch->type == SR_CHANNEL_LOGIC) {
-               if (rigol_ds_config_set(sdi->conn, ":WAV:SOUR LA") != SR_OK)
+               if (rigol_ds_config_set(sdi, ":WAV:SOUR LA") != SR_OK)
                        return SR_ERR;
        } else {
                if (rigol_ds_config_set(sdi, ":WAV:SOUR CHAN%d",
@@ -440,7 +440,7 @@ SR_PRIV int rigol_ds_channel_start(const struct sr_dev_inst *sdi)
                break;
        case PROTOCOL_V3:
                if (ch->type == SR_CHANNEL_LOGIC) {
-                       if (rigol_ds_config_set(sdi->conn, ":WAV:SOUR LA") != SR_OK)
+                       if (rigol_ds_config_set(sdi, ":WAV:SOUR LA") != SR_OK)
                                return SR_ERR;
                } else {
                        if (rigol_ds_config_set(sdi, ":WAV:SOUR CHAN%d",