Hi Torsten, thanks for your review. On 10/30/2014 08:49 AM, Torsten Duwe wrote: > On Wed, Oct 29, 2014 at 11:31:43PM -0400, Sebastien Bourdelin wrote: >> Reworked in the algorithm: >> - Fixed the polarity setting >> - Taken in consideration the first transition > On "wrong" polarity, I guess? Well, "wrong" or "good" polarity, i think we cannot assume the first period will be relevant because the measure can start at anytime, so we must wait for the first relevant edge without taking in consideration what happens before IMHO. That is what i mean by "Taken in consideration the first transition" >> - Using the 'None' state instead of -1 and 0 value >> - Simplify the algorithm and remove useless branches and variables > Python really isn't my favourite programming language. > >> - Avoid re-calculated the same thing more than once >> - Renamed few variables for a better understanding >> - Duty cycle precision changed to floating value >> >> Otherwise: >> - Added a meta OUTPUT for the duty cycle average >> - Renamed the polarity option: >> 'polarity', 'active low/high' are well-understood terms. > Indeed, PWM can be viewed this way. >> - Added comments > I had tried to be as clear as possible, but you never > know until someone else tries to understand your code. > More comment is good, obviously. > > Does the example still work i.e. functionality is unchanged? > If so, the patch is fine with me. Yes it works like before, the granularity is finest, i prefer to use floating values rather integer if you are ok with that. I restored your binary output that i deleted in my previous patch, my bad. I used the test in http://sigrok.org/gitweb/?p=sigrok-dumps.git;a=tree;f=pwm/alsa_test;hb=HEAD to verify there was no differences in the binary output after applying my patch, it's ok.
> > Torsten > Regards, Sebastien. ------------------------------------------------------------------------------ _______________________________________________ sigrok-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sigrok-devel

