]> sigrok.org Git - libsigrok.git/commitdiff
hantek-dso: dso2250: Report the sample rate back.
authorPhilipp Marek <redacted>
Sat, 18 Nov 2017 14:04:03 +0000 (15:04 +0100)
committerUwe Hermann <redacted>
Wed, 10 Jan 2018 21:34:20 +0000 (22:34 +0100)
So that cursor (and other) measurements and the time axis are correct.

src/hardware/hantek-dso/api.c

index 6994cbf6e7f65e23c302e81d7cefba7637774390..4903eab2061ab5eb8c04c1e7ade4e82852ec08bd 100644 (file)
@@ -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;