From: Philipp Marek Date: Sat, 18 Nov 2017 14:04:03 +0000 (+0100) Subject: hantek-dso: dso2250: Report the sample rate back. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=3b2b703177ba3c037f8f03539f72627d1342634d;p=libsigrok.git hantek-dso: dso2250: Report the sample rate back. So that cursor (and other) measurements and the time axis are correct. --- diff --git a/src/hardware/hantek-dso/api.c b/src/hardware/hantek-dso/api.c index 6994cbf6..4903eab2 100644 --- a/src/hardware/hantek-dso/api.c +++ b/src/hardware/hantek-dso/api.c @@ -62,6 +62,7 @@ static const uint32_t devopts[] = { SR_CONF_TRIGGER_SOURCE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, SR_CONF_TRIGGER_SLOPE | SR_CONF_GET | SR_CONF_SET, SR_CONF_BUFFERSIZE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, SR_CONF_NUM_VDIV | SR_CONF_GET, }; @@ -430,6 +431,11 @@ static int config_get(uint32_t key, GVariant **data, *data = g_variant_new("(tt)", timebases[devc->timebase][0], timebases[devc->timebase][1]); break; + case SR_CONF_SAMPLERATE: + *data = g_variant_new_uint64( + timebases[devc->timebase][1]/ + timebases[devc->timebase][0]); + break; case SR_CONF_BUFFERSIZE: *data = g_variant_new_uint64(devc->framesize); break;