]> sigrok.org Git - libsigrok.git/blobdiff - hardware/hantek-dso/api.c
sr/drivers: fix off-by-one if frontend-initiated probe configuration
[libsigrok.git] / hardware / hantek-dso / api.c
index 72f7079365b627dda049cb796d750047d141ce9f..fbb84760386b3e9ab58e9e7e44e134e69ec9bc02 100644 (file)
@@ -193,9 +193,9 @@ static int configure_probes(struct context *ctx, const GSList *probes)
        ctx->ch1_enabled = ctx->ch2_enabled = FALSE;
        for (l = probes; l; l = l->next) {
                probe = (struct sr_probe *)l->data;
-               if (probe->index == 1)
+               if (probe->index == 0)
                        ctx->ch1_enabled = probe->enabled;
-               else if (probe->index == 2)
+               else if (probe->index == 1)
                        ctx->ch2_enabled = probe->enabled;
        }