]> sigrok.org Git - libsigrok.git/blobdiff - hardware/hantek-dso/dso.c
hantek-dso: fix channel selection
[libsigrok.git] / hardware / hantek-dso / dso.c
index 278b2ebef021094a8d41bea16dd49c8a45aeb3b2..ab6d09ecb8a8332fb7b464a819f146284322a507 100644 (file)
@@ -253,9 +253,9 @@ SR_PRIV int dso_set_trigger_samplerate(struct context *ctx)
        }
        cmdstring[2] |= tmp & 0x07;
 cmdstring[2] = 0x45;
-       /* Selected channel */
-       cmdstring[3] = (ctx->selected_channel & 0x03) << 6;
-cmdstring[3] = 0x02;
+       /* Enabled channels */
+       tmp = (((ctx->ch2_enabled ? 1 : 0) << 1) + (ctx->ch1_enabled ? 1 : 0)) - 1;
+       cmdstring[3] = tmp;
 
        /* TODO: Fast rates channel */
        cmdstring[3] |= 0 << 5;