Hi,
On Sat, 29 Apr 2017 21:25:56 +0200
Wolfram Sang <w...@the-dreams.de> wrote:

> Hi,
> 
> > With trigger enabled, and with pulseview, a second (or more)
> > acquisition start immediatly 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 patch may fix bug #809  
> 
> It does for me, thanks!
> 
Great
> > 
> > Signed-off-by: Gwenhael Goavec-Merou
> > <gwenhael.goavec-me...@trabucayre.com> ---
> >  src/hardware/openbench-logic-sniffer/api.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/src/hardware/openbench-logic-sniffer/api.c
> > b/src/hardware/openbench-logic-sniffer/api.c index 1e22c5b..c019e44
> > 100644 --- a/src/hardware/openbench-logic-sniffer/api.c
> > +++ b/src/hardware/openbench-logic-sniffer/api.c
> > @@ -480,6 +480,15 @@ 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");
> > +           for (i = 0; i < 5; i++) {
> > +                   if (send_shortcommand(serial,
> > CMD_RESET) != SR_OK)
> > +                           return SR_ERR;
> > +           }  
> 
> Now we have the reset sequence twice in the code. What about a
> factoring out a dev_reset function which then gets called both times?
> 
In fact it's my first idea, but due to the few lines of code I had a
doubt. I'm agree with this approach and will send a v2 patch with this
modification.
> Regards,
> 
>    Wolfram

Thanks for the review.

Regards,
Gwen

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to