From: Bert Vermeulen Date: Fri, 25 Jan 2013 02:17:36 +0000 (+0100) Subject: Deprecate SR_DI_CUR_SAMPLERATE. X-Git-Tag: dsupstream~318 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=123e13138385055003cb6bc09e74df783df5af85;p=libsigrok.git Deprecate SR_DI_CUR_SAMPLERATE. This is replaced by SR_CONF_SAMPLERATE. --- diff --git a/hardware/alsa/api.c b/hardware/alsa/api.c index fdea5f7e..86ab6a7c 100644 --- a/hardware/alsa/api.c +++ b/hardware/alsa/api.c @@ -151,7 +151,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_CUR_SAMPLERATE: + case SR_CONF_SAMPLERATE: *data = &devc->cur_samplerate; break; default: diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index e340e540..7da0d97b 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -798,7 +798,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) case SR_DI_TRIGGER_TYPES: *data = (char *)TRIGGER_TYPES; break; - case SR_DI_CUR_SAMPLERATE: + case SR_CONF_SAMPLERATE: if (sdi) { devc = sdi->priv; *data = &devc->cur_samplerate; diff --git a/hardware/chronovu-la8/api.c b/hardware/chronovu-la8/api.c index ddda8733..4c349e57 100644 --- a/hardware/chronovu-la8/api.c +++ b/hardware/chronovu-la8/api.c @@ -301,7 +301,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) sr_spew("%s: Returning trigger types: %s.", __func__, TRIGGER_TYPES); break; - case SR_DI_CUR_SAMPLERATE: + case SR_CONF_SAMPLERATE: if (sdi) { devc = sdi->priv; *data = &devc->cur_samplerate; diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index 6c211cd7..7fc00fb7 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -234,7 +234,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_CUR_SAMPLERATE: + case SR_CONF_SAMPLERATE: *data = &cur_samplerate; break; case SR_DI_PATTERNS: diff --git a/hardware/fx2lafw/fx2lafw.c b/hardware/fx2lafw/fx2lafw.c index 1717f9d0..4b442530 100644 --- a/hardware/fx2lafw/fx2lafw.c +++ b/hardware/fx2lafw/fx2lafw.c @@ -613,7 +613,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) case SR_DI_TRIGGER_TYPES: *data = TRIGGER_TYPES; break; - case SR_DI_CUR_SAMPLERATE: + case SR_CONF_SAMPLERATE: if (sdi) { devc = sdi->priv; *data = &devc->cur_samplerate; diff --git a/hardware/hantek-dso/api.c b/hardware/hantek-dso/api.c index 0df6a5b8..e4d9f6f7 100644 --- a/hardware/hantek-dso/api.c +++ b/hardware/hantek-dso/api.c @@ -451,7 +451,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) *data = coupling; break; /* TODO remove this */ - case SR_DI_CUR_SAMPLERATE: + case SR_CONF_SAMPLERATE: *data = &tmp; break; default: diff --git a/hardware/link-mso19/api.c b/hardware/link-mso19/api.c index 98fc9b78..cde523ec 100644 --- a/hardware/link-mso19/api.c +++ b/hardware/link-mso19/api.c @@ -309,7 +309,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) case SR_DI_TRIGGER_TYPES: *data = (char *)TRIGGER_TYPES; break; - case SR_DI_CUR_SAMPLERATE: + case SR_CONF_SAMPLERATE: if (sdi) { devc = sdi->priv; *data = &devc->cur_rate; diff --git a/hardware/openbench-logic-sniffer/api.c b/hardware/openbench-logic-sniffer/api.c index daf2311c..845dd254 100644 --- a/hardware/openbench-logic-sniffer/api.c +++ b/hardware/openbench-logic-sniffer/api.c @@ -264,7 +264,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) case SR_DI_TRIGGER_TYPES: *data = (char *)TRIGGER_TYPES; break; - case SR_DI_CUR_SAMPLERATE: + case SR_CONF_SAMPLERATE: if (sdi) { devc = sdi->priv; *data = &devc->cur_samplerate; diff --git a/hardware/uni-t-dmm/api.c b/hardware/uni-t-dmm/api.c index b019f0f2..7c4c6b89 100644 --- a/hardware/uni-t-dmm/api.c +++ b/hardware/uni-t-dmm/api.c @@ -200,7 +200,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) *data = hwcaps; sr_spew("%s: Returning hwcaps.", __func__); break; - case SR_DI_CUR_SAMPLERATE: + case SR_CONF_SAMPLERATE: /* TODO: Get rid of this. */ *data = NULL; sr_spew("%s: Returning current samplerate.", __func__); diff --git a/hardware/zeroplus-logic-cube/zeroplus.c b/hardware/zeroplus-logic-cube/zeroplus.c index b8f9fb1a..ec34d306 100644 --- a/hardware/zeroplus-logic-cube/zeroplus.c +++ b/hardware/zeroplus-logic-cube/zeroplus.c @@ -541,7 +541,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) *data = TRIGGER_TYPES; sr_spew("zp: %s: Returning triggertypes: %s.", __func__, TRIGGER_TYPES); break; - case SR_DI_CUR_SAMPLERATE: + case SR_CONF_SAMPLERATE: if (sdi) { devc = sdi->priv; *data = &devc->cur_samplerate; diff --git a/libsigrok.h b/libsigrok.h index a9c4cd48..d8b90f98 100644 --- a/libsigrok.h +++ b/libsigrok.h @@ -553,8 +553,6 @@ enum { SR_DI_HWCAPS, /** Types of logic trigger supported, out of "01crf" (char *). */ SR_DI_TRIGGER_TYPES, - /** The currently set samplerate in Hz (uint64_t). */ - SR_DI_CUR_SAMPLERATE, /** Supported patterns (in pattern generator mode). */ SR_DI_PATTERNS, /** Supported buffer sizes. */ diff --git a/output/chronovu_la8.c b/output/chronovu_la8.c index 5e5984d7..6074f053 100644 --- a/output/chronovu_la8.c +++ b/output/chronovu_la8.c @@ -129,7 +129,7 @@ static int init(struct sr_output *o) ctx->unitsize = (ctx->num_enabled_probes + 7) / 8; if (sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) { - o->sdi->driver->config_get(SR_DI_CUR_SAMPLERATE, + o->sdi->driver->config_get(SR_CONF_SAMPLERATE, (const void **)&samplerate, o->sdi); ctx->samplerate = *samplerate; } else diff --git a/output/csv.c b/output/csv.c index a671c292..10798a73 100644 --- a/output/csv.c +++ b/output/csv.c @@ -100,7 +100,7 @@ static int init(struct sr_output *o) num_probes = g_slist_length(o->sdi->probes); if (sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) { - o->sdi->driver->config_get(SR_DI_CUR_SAMPLERATE, + o->sdi->driver->config_get(SR_CONF_SAMPLERATE, (const void **)&samplerate, o->sdi); ctx->samplerate = *samplerate; } else diff --git a/output/gnuplot.c b/output/gnuplot.c index 13c7adb7..f70625a9 100644 --- a/output/gnuplot.c +++ b/output/gnuplot.c @@ -110,7 +110,7 @@ static int init(struct sr_output *o) num_probes = g_slist_length(o->sdi->probes); comment[0] = '\0'; if (sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) { - o->sdi->driver->config_get(SR_DI_CUR_SAMPLERATE, + o->sdi->driver->config_get(SR_CONF_SAMPLERATE, (const void **)&samplerate, o->sdi); if (!(frequency_s = sr_samplerate_string(*samplerate))) { sr_err("%s: sr_samplerate_string failed", __func__); diff --git a/output/ols.c b/output/ols.c index f5eaad45..40e48f91 100644 --- a/output/ols.c +++ b/output/ols.c @@ -70,7 +70,7 @@ static int init(struct sr_output *o) ctx->unitsize = (num_enabled_probes + 7) / 8; if (o->sdi->driver && sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) - o->sdi->driver->config_get(SR_DI_CUR_SAMPLERATE, + o->sdi->driver->config_get(SR_CONF_SAMPLERATE, (const void **)&samplerate, o->sdi); else { tmp = 0; diff --git a/output/text/text.c b/output/text/text.c index 7c442ad8..8bbe3b51 100644 --- a/output/text/text.c +++ b/output/text/text.c @@ -124,7 +124,7 @@ SR_PRIV int init(struct sr_output *o, int default_spl, enum outputmode mode) snprintf(ctx->header, 511, "%s\n", PACKAGE_STRING); num_probes = g_slist_length(o->sdi->probes); if (o->sdi->driver || sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) { - ret = o->sdi->driver->config_get(SR_DI_CUR_SAMPLERATE, + ret = o->sdi->driver->config_get(SR_CONF_SAMPLERATE, (const void **)&samplerate, o->sdi); if (ret != SR_OK) goto err; diff --git a/output/vcd.c b/output/vcd.c index 39030c78..39759d64 100644 --- a/output/vcd.c +++ b/output/vcd.c @@ -95,7 +95,7 @@ static int init(struct sr_output *o) PACKAGE, PACKAGE_VERSION); if (o->sdi->driver && sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) { - o->sdi->driver->config_get(SR_DI_CUR_SAMPLERATE, + o->sdi->driver->config_get(SR_CONF_SAMPLERATE, (const void **)&samplerate, o->sdi); ctx->samplerate = *samplerate; if (!((samplerate_s = sr_samplerate_string(ctx->samplerate)))) { diff --git a/session_driver.c b/session_driver.c index 52949722..e4f6a9f4 100644 --- a/session_driver.c +++ b/session_driver.c @@ -156,7 +156,7 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_CUR_SAMPLERATE: + case SR_CONF_SAMPLERATE: if (sdi) { vdev = sdi->priv; *data = &vdev->samplerate; diff --git a/session_file.c b/session_file.c index 3168acba..53e6d1e6 100644 --- a/session_file.c +++ b/session_file.c @@ -254,7 +254,7 @@ SR_API int sr_session_save(const char *filename, const struct sr_dev_inst *sdi, fprintf(meta, "unitsize = %d\n", unitsize); fprintf(meta, "total probes = %d\n", g_slist_length(sdi->probes)); if (sr_dev_has_hwcap(sdi, SR_CONF_SAMPLERATE)) { - if (sr_info_get(sdi->driver, SR_DI_CUR_SAMPLERATE, + if (sr_info_get(sdi->driver, SR_CONF_SAMPLERATE, (const void **)&samplerate, sdi) == SR_OK) { s = sr_samplerate_string(*samplerate); fprintf(meta, "samplerate = %s\n", s);