From 8489264f1e3ef07ba8f1143ed62fa88d90980f94 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Tue, 3 Jul 2012 23:59:12 +0200 Subject: [PATCH] sr: demodevice: Reset sample limit when setting time limit and vice versa Only one limit should be active at a time. Make sure that the sample limit is disabled when a time limit is set and vice versa. Signed-off-by: Lars-Peter Clausen --- hardware/demo/demo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index e511c0a6..eb554787 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -248,12 +248,14 @@ static int hw_dev_config_set(int dev_index, int hwcap, const void *value) cur_samplerate); ret = SR_OK; } else if (hwcap == SR_HWCAP_LIMIT_SAMPLES) { + limit_msec = 0; limit_samples = *(const uint64_t *)value; sr_dbg("demo: %s: setting limit_samples to %" PRIu64, __func__, limit_samples); ret = SR_OK; } else if (hwcap == SR_HWCAP_LIMIT_MSEC) { limit_msec = *(const uint64_t *)value; + limit_samples = 0; sr_dbg("demo: %s: setting limit_msec to %" PRIu64, __func__, limit_msec); ret = SR_OK;