]> sigrok.org Git - libsigrok.git/commitdiff
asix-sigma: Publish capture ratio correctly.
authorBert Vermeulen <redacted>
Sun, 4 May 2014 07:34:24 +0000 (00:34 -0700)
committerBert Vermeulen <redacted>
Sun, 4 May 2014 07:36:46 +0000 (00:36 -0700)
hardware/asix-sigma/asix-sigma.c

index c57ce367fa1075f46cdb0fa5f7007943f10f99d6..e3a56d35b9b3fc49a8fece85f2b2825a96bc2cb5 100644 (file)
@@ -809,13 +809,19 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
 
        (void)cg;
 
+       if (!sdi)
+               return SR_ERR;
+       devc = sdi->priv;
+
        switch (id) {
        case SR_CONF_SAMPLERATE:
-               if (sdi) {
-                       devc = sdi->priv;
-                       *data = g_variant_new_uint64(devc->cur_samplerate);
-               } else
-                       return SR_ERR;
+               *data = g_variant_new_uint64(devc->cur_samplerate);
+               break;
+       case SR_CONF_LIMIT_MSEC:
+               *data = g_variant_new_uint64(devc->limit_msec);
+               break;
+       case SR_CONF_CAPTURE_RATIO:
+               *data = g_variant_new_uint64(devc->capture_ratio);
                break;
        default:
                return SR_ERR_NA;