X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/da1f16d6ef6f9433b9a5a3475541ebbf45c1ba72..50282b85e45dba28ece1cc10ab3f063ebca8b4c8:/common/lfdemod.c diff --git a/common/lfdemod.c b/common/lfdemod.c index 8bbe5beb..5fec933f 100644 --- a/common/lfdemod.c +++ b/common/lfdemod.c @@ -25,15 +25,13 @@ void dummy(char *fmt, ...){} #define prnt dummy #endif -uint8_t justNoise(uint8_t *BitStream, size_t size) -{ - static const uint8_t THRESHOLD = 123; - //test samples are not just noise - uint8_t justNoise1 = 1; - for(size_t idx=0; idx < size && justNoise1 ;idx++){ - justNoise1 = BitStream[idx] < THRESHOLD; - } - return justNoise1; +//test samples are not just noise +uint8_t justNoise(uint8_t *bits, size_t size) { + #define THRESHOLD 123 + uint8_t val = 1; + for(size_t idx=0; idx < size && val ;idx++) + val = bits[idx] < THRESHOLD; + return val; } //by marshmellow