X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=blobdiff_plain;f=src%2Fhardware%2Fikalogic-scanaplus%2Fapi.c;h=67da9b39c1a3952533aeaa5992e2f78846aef104;hp=dd5d09ffef51342acb8a26a7af226387c2859310;hb=05199c0ac9f15f229d43e50e86c4c1eadc55deac;hpb=8bf18daabbf3cb0fec6c178b4bc7f6283a314e45 diff --git a/src/hardware/ikalogic-scanaplus/api.c b/src/hardware/ikalogic-scanaplus/api.c index dd5d09ff..67da9b39 100644 --- a/src/hardware/ikalogic-scanaplus/api.c +++ b/src/hardware/ikalogic-scanaplus/api.c @@ -28,8 +28,11 @@ #define SAMPLE_BUF_SIZE (8 * 1024 * 1024) -static const uint32_t devopts[] = { +static const uint32_t drvopts[] = { SR_CONF_LOGIC_ANALYZER, +}; + +static const uint32_t devopts[] = { SR_CONF_LIMIT_SAMPLES | SR_CONF_SET, SR_CONF_LIMIT_MSEC | SR_CONF_SET, SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, @@ -43,12 +46,8 @@ static const char *channel_names[] = { /* Note: The IKALOGIC ScanaPLUS always samples at 100MHz. */ static const uint64_t samplerates[1] = { SR_MHZ(100) }; -static void clear_helper(void *priv) +static void clear_helper(struct dev_context *devc) { - struct dev_context *devc; - - devc = priv; - ftdi_free(devc->ftdic); g_free(devc->compressed_buf); g_free(devc->sample_buf); @@ -56,7 +55,7 @@ static void clear_helper(void *priv) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear_with_callback(di, clear_helper); + return std_dev_clear_with_callback(di, (std_dev_clear_callback)clear_helper); } static GSList *scan(struct sr_dev_driver *di, GSList *options) @@ -274,14 +273,9 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * GVariant *gvar; GVariantBuilder gvb; - (void)sdi; - (void)cg; - switch (key) { case SR_CONF_DEVICE_OPTIONS: - *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, - devopts, ARRAY_SIZE(devopts), sizeof(uint32_t)); - break; + return STD_CONFIG_LIST(key, data, sdi, cg, NULL, drvopts, devopts); case SR_CONF_SAMPLERATE: g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}")); gvar = g_variant_new_fixed_array(G_VARIANT_TYPE("t"),