X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fzeroplus-logic-cube%2Fapi.c;h=d85a8ca07ae8cba0987135083e87c5dd524080f2;hb=60cc6f85795315d3257a55cc257bdc3e511b6f45;hp=2117afbc4d29be633face6912c591e2da881dc59;hpb=f6beaac55ca58c406d6621038abe57c16a47e87f;p=libsigrok.git diff --git a/hardware/zeroplus-logic-cube/api.c b/hardware/zeroplus-logic-cube/api.c index 2117afbc..d85a8ca0 100644 --- a/hardware/zeroplus-logic-cube/api.c +++ b/hardware/zeroplus-logic-cube/api.c @@ -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 } @@ -238,7 +237,7 @@ SR_PRIV int zp_set_samplerate(struct dev_context *devc, uint64_t samplerate) return SR_OK; } -static int clear_instances(void) +static int dev_clear(void) { return std_dev_clear(di, NULL); } @@ -464,13 +463,16 @@ static int dev_close(struct sr_dev_inst *sdi) static int cleanup(void) { - return clear_instances(); + 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, @@ -663,7 +671,7 @@ SR_PRIV struct sr_dev_driver zeroplus_logic_cube_driver_info = { .cleanup = cleanup, .scan = scan, .dev_list = dev_list, - .dev_clear = cleanup, + .dev_clear = dev_clear, .config_get = config_get, .config_set = config_set, .config_list = config_list,