From: Russ Dill Date: Tue, 3 Dec 2013 05:57:46 +0000 (-0800) Subject: zeroplus: Clip sampling sizes larger that our sample memory X-Git-Tag: libsigrok-0.3.0~474 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c38e64c7425aaf82f8a49b702cae764c403d2acd;p=libsigrok.git zeroplus: Clip sampling sizes larger that our sample memory Otherwise, we'll return a non-sensical result for our memory_size enumeration. --- diff --git a/hardware/zeroplus-logic-cube/protocol.c b/hardware/zeroplus-logic-cube/protocol.c index 470debe6..158b77ca 100644 --- a/hardware/zeroplus-logic-cube/protocol.c +++ b/hardware/zeroplus-logic-cube/protocol.c @@ -57,6 +57,9 @@ SR_PRIV int clz(unsigned int x) SR_PRIV int set_limit_samples(struct dev_context *devc, uint64_t samples) { + if (samples > devc->max_sample_depth) + samples = devc->max_sample_depth; + devc->limit_samples = samples; if (samples <= 2 * 1024)