]> sigrok.org Git - libsigrok.git/blobdiff - hardware/zeroplus-logic-cube/zeroplus.c
sr/drivers: fix off-by-one if frontend-initiated probe configuration
[libsigrok.git] / hardware / zeroplus-logic-cube / zeroplus.c
index abe6dabf3c29a82aff7260ae8b5bdf60255d7d95..683203aef28630a8ba69722eefdf98abbe91f7d9 100644 (file)
@@ -59,9 +59,11 @@ typedef struct {
 static model_t zeroplus_models[] = {
        {0x0c12, 0x7009, "LAP-C(16064)",  16, 64,   100},
        {0x0c12, 0x700A, "LAP-C(16128)",  16, 128,  200},
+       /* TODO: we don't know anything about these
        {0x0c12, 0x700B, "LAP-C(32128)",  32, 128,  200},
        {0x0c12, 0x700C, "LAP-C(321000)", 32, 1024, 200},
        {0x0c12, 0x700D, "LAP-C(322000)", 32, 2048, 200},
+       */
        {0x0c12, 0x700E, "LAP-C(16032)",  16, 32,   100},
        {0x0c12, 0x7016, "LAP-C(162000)", 16, 2048, 200},
        { 0, 0, 0, 0, 0, 0 }
@@ -201,7 +203,7 @@ static int configure_probes(const struct sr_dev_inst *sdi, const GSList *probes)
                probe = (struct sr_probe *)l->data;
                if (probe->enabled == FALSE)
                        continue;
-               probe_bit = 1 << (probe->index - 1);
+               probe_bit = 1 << (probe->index);
                ctx->probe_mask |= probe_bit;
 
                if (probe->trigger) {
@@ -505,17 +507,6 @@ static int hw_info_get(int info_id, const void **data,
        return SR_OK;
 }
 
-static int hw_dev_status_get(int dev_index)
-{
-       struct sr_dev_inst *sdi;
-
-       sdi = sr_dev_inst_get(zdi->instances, dev_index);
-       if (sdi)
-               return sdi->status;
-       else
-               return SR_ST_NOT_FOUND;
-}
-
 static int set_samplerate(const struct sr_dev_inst *sdi, uint64_t samplerate)
 {
        struct context *ctx;
@@ -674,7 +665,6 @@ SR_PRIV struct sr_dev_driver zeroplus_logic_cube_driver_info = {
        .dev_open = hw_dev_open,
        .dev_close = hw_dev_close,
        .info_get = hw_info_get,
-       .dev_status_get = hw_dev_status_get,
        .dev_config_set = hw_dev_config_set,
        .dev_acquisition_start = hw_dev_acquisition_start,
        .dev_acquisition_stop = hw_dev_acquisition_stop,