]> sigrok.org Git - libsigrok.git/blobdiff - hardware/zeroplus-logic-cube/api.c
filter.c: Work around const warning.
[libsigrok.git] / hardware / zeroplus-logic-cube / api.c
index 637f22ce93f3896cf18e42fa5ede69e48f3cf547..2ff8cc932ef70f73dd8c21a494569ff5db6b3cfa 100644 (file)
@@ -45,11 +45,10 @@ static const struct zp_model zeroplus_models[] = {
        {0x0c12, 0x7002, "LAP-16128U",    16, 128,  200},
        {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},
-       */
+       /* We don't yet support 32 probes */
+       {0x0c12, 0x700b, "LAP-C(32128)",  16, 128,  200},
+       {0x0c12, 0x700c, "LAP-C(321000)", 16, 1024, 200},
+       {0x0c12, 0x700d, "LAP-C(322000)", 16, 2048, 200},
        {0x0c12, 0x700e, "LAP-C(16032)",  16, 32,   100},
        {0x0c12, 0x7016, "LAP-C(162000)", 16, 2048, 200},
        { 0, 0, 0, 0, 0, 0 }
@@ -308,10 +307,10 @@ static GSList *scan(GSList *options)
                devc->prof = prof;
                devc->num_channels = prof->channels;
 #ifdef ZP_EXPERIMENTAL
-               devc->max_memory_size = 128 * 1024;
+               devc->max_sample_depth = 128 * 1024;
                devc->max_samplerate = 200;
 #else
-               devc->max_memory_size = prof->sample_depth * 1024;
+               devc->max_sample_depth = prof->sample_depth * 1024;
                devc->max_samplerate = prof->max_sampling_freq;
 #endif
                devc->max_samplerate *= SR_MHZ(1);
@@ -467,10 +466,13 @@ static int cleanup(void)
        return dev_clear();
 }
 
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+               const struct sr_probe_group *probe_group)
 {
        struct dev_context *devc;
 
+       (void)probe_group;
+
        switch (id) {
        case SR_CONF_SAMPLERATE:
                if (sdi) {
@@ -488,10 +490,13 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
        return SR_OK;
 }
 
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+               const struct sr_probe_group *probe_group)
 {
        struct dev_context *devc;
 
+       (void)probe_group;
+
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
@@ -514,12 +519,15 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
        return SR_OK;
 }
 
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+               const struct sr_probe_group *probe_group)
 {
        struct dev_context *devc;
        GVariant *gvar;
        GVariantBuilder gvb;
 
+       (void)probe_group;
+
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
                *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
@@ -609,8 +617,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi,
        analyzer_read_start(usb->devhdl);
        /* Send the incoming transfer to the session bus. */
        n = get_memory_size(devc->memory_size);
-       if (devc->max_memory_size * 4 < n)
-               n = devc->max_memory_size * 4;
+       if (devc->max_sample_depth * 4 < n)
+               n = devc->max_sample_depth * 4;
        for (packet_num = 0; packet_num < n / PACKET_SIZE; packet_num++) {
                res = analyzer_read_data(usb->devhdl, buf, PACKET_SIZE);
                sr_info("Tried to read %d bytes, actually read %d bytes.",