]> sigrok.org Git - libsigrok.git/blobdiff - hardware/chronovu-la8/driver.c
sr/drivers: fix off-by-one if frontend-initiated probe configuration
[libsigrok.git] / hardware / chronovu-la8 / driver.c
index 37b96c4ad0a3dc290eadcafce81d08d8ded80a1d..2b697bbb27953f7fe2971413db1b1a36b5ba0f5f 100644 (file)
@@ -20,8 +20,8 @@
 
 #include <ftdi.h>
 #include <glib.h>
-#include "sigrok.h"
-#include "sigrok-internal.h"
+#include "libsigrok.h"
+#include "libsigrok-internal.h"
 #include "driver.h"
 
 /* Probes are numbered 0-7. */
@@ -37,7 +37,7 @@ SR_PRIV const char *probe_names[NUM_PROBES + 1] = {
        NULL,
 };
 
-/* This will be initialized via hw_dev_info_get()/SR_DI_SAMPLERATES. */
+/* This will be initialized via hw_info_get()/SR_DI_SAMPLERATES. */
 SR_PRIV uint64_t supported_samplerates[255 + 1] = { 0 };
 
 /*
@@ -354,7 +354,7 @@ SR_PRIV int configure_probes(struct context *ctx, const GSList *probes)
                        return SR_ERR;
                }
 
-               probe_bit = (1 << (probe->index - 1));
+               probe_bit = (1 << (probe->index));
 
                /* Configure the probe's trigger mask and trigger pattern. */
                for (tc = probe->trigger; tc && *tc; tc++) {
@@ -378,7 +378,7 @@ SR_PRIV int configure_probes(struct context *ctx, const GSList *probes)
        return SR_OK;
 }
 
-SR_PRIV int set_samplerate(struct sr_dev_inst *sdi, uint64_t samplerate)
+SR_PRIV int set_samplerate(const struct sr_dev_inst *sdi, uint64_t samplerate)
 {
        struct context *ctx;