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 <Russ.Dill@gmail.com>
This commit is contained in:
Russ Dill 2013-12-02 22:00:30 -08:00 committed by Bert Vermeulen
parent 05f853b5c3
commit 4c1433d172
1 changed files with 5 additions and 1 deletions

View 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;
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 */