]> sigrok.org Git - libsigrok.git/commitdiff
zeroplus: Ignore capture ratio if there is no trigger
authorRuss Dill <redacted>
Tue, 3 Dec 2013 06:00:30 +0000 (22:00 -0800)
committerBert Vermeulen <redacted>
Fri, 3 Jan 2014 14:09:10 +0000 (15:09 +0100)
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 <redacted>
hardware/zeroplus-logic-cube/protocol.c

index 0f68350e3ad1f700390abc888876ec20e0b6abfa..205bf560e168f45f043f11385cadf0e149222203 100644 (file)
@@ -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 */