From: Gwenhael Goavec-Merou Date: Sun, 30 Apr 2017 13:57:40 +0000 (+0200) Subject: openbench-logic-sniffer: fix acquisition restart with trigger enabled X-Git-Tag: libsigrok-0.5.0~76 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=b853eb76fbee3c03d64c03b1cb8af0585684dfcf;hp=244995a2e3cef0f971e21faf82531e785e552f9e openbench-logic-sniffer: fix acquisition restart with trigger enabled With trigger enabled, and with PulseView, a second (or more) acquisition starts immediately instead of blocking. It's mandatory to try several times to have a correct behavior. According to http://mygizmos.org/ols/Logic-Sniffer-FPGA-Spec.pdf section 2.3.1 p.8, the Openbench Logic Sniffer must be reset before each arm command. This fixes bug #809. Signed-off-by: Gwenhael Goavec-Merou --- diff --git a/src/hardware/openbench-logic-sniffer/api.c b/src/hardware/openbench-logic-sniffer/api.c index c0459535..5e74a523 100644 --- a/src/hardware/openbench-logic-sniffer/api.c +++ b/src/hardware/openbench-logic-sniffer/api.c @@ -473,6 +473,14 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_ERR; } if (devc->num_stages > 0) { + /* + * According to http://mygizmos.org/ols/Logic-Sniffer-FPGA-Spec.pdf + * reset command must be send prior each arm command + */ + sr_dbg("Send reset command before trigger configure"); + if (ols_send_reset(serial) != SR_OK) + return SR_ERR; + delaycount = readcount * (1 - devc->capture_ratio / 100.0); devc->trigger_at = (readcount - delaycount) * 4 - devc->num_stages; for (i = 0; i <= devc->num_stages; i++) {