Mercurial > hg > beaglert
diff include/PulseIn.h @ 314:611306d840b3 prerelease
Merge
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Fri, 27 May 2016 19:00:43 +0100 |
parents | 493a07f6ec09 |
children |
line wrap: on
line diff
--- a/include/PulseIn.h Fri May 27 18:55:34 2016 +0100 +++ b/include/PulseIn.h Fri May 27 19:00:43 2016 +0100 @@ -46,7 +46,7 @@ * than hasPulsed() is because user might not query for hasPulsed() every sample, * so we are safe so long as they call hasPulsed() or check() at least once per buffer. * Also, results are cached (i.e.: we do not check() for pulses twice for the same context. - * context->audioSampleCount is used as an identifier. + * context->audioFramesElapsed is used as an identifier. */ void check(BelaContext* context); @@ -58,7 +58,7 @@ * @return the length of the pulse if a pulse ending was detected at sample n, zero otherwise. */ int hasPulsed(BelaContext* context, int frame){//let's leave this in PulseIn.h to allow the compiler to optimize out the call. - if(_lastContext != context->audioSampleCount){ // check for pulses in the whole context and cache the result + if(_lastContext != context->audioFramesElapsed){ // check for pulses in the whole context and cache the result check(context); } return _array[frame];