From: Russ Dill Date: Tue, 3 Dec 2013 06:00:30 +0000 (-0800) Subject: zeroplus: Ignore capture ratio if there is no trigger X-Git-Tag: libsigrok-0.3.0~345 X-Git-Url: https://sigrok.org/gitweb/?a=commitdiff_plain;h=4c1433d172e974f8b47ade71ef5e9557ba77a9f5;p=libsigrok.git zeroplus: Ignore capture ratio if there is no trigger If there is no trigger, don't try to capture anything before it. There won't be any because we trigger immediately. Signed-off-by: Russ Dill --- diff --git a/hardware/zeroplus-logic-cube/protocol.c b/hardware/zeroplus-logic-cube/protocol.c index 0f68350e..205bf560 100644 --- a/hardware/zeroplus-logic-cube/protocol.c +++ b/hardware/zeroplus-logic-cube/protocol.c @@ -98,7 +98,11 @@ SR_PRIV void set_triggerbar(struct dev_context *devc) trigger_depth = get_memory_size(devc->memory_size) / 4; if (devc->limit_samples < trigger_depth) trigger_depth = devc->limit_samples; - triggerbar = trigger_depth * devc->capture_ratio / 100; + + if (devc->trigger) + triggerbar = trigger_depth * devc->capture_ratio / 100; + else + triggerbar = 0; ramsize_trigger = trigger_depth - triggerbar; /* Matches USB packet captures from official app/driver */