From: Bert Vermeulen Date: Sun, 4 May 2014 07:34:24 +0000 (-0700) Subject: asix-sigma: Publish capture ratio correctly. X-Git-Tag: libsigrok-0.3.0~18 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=fb2e6de774816b4298dcc9eed66d2d9282d53cab;p=libsigrok.git asix-sigma: Publish capture ratio correctly. --- diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index c57ce367..e3a56d35 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -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;