From: marshmellow42 Date: Mon, 20 Jun 2016 04:42:03 +0000 (-0400) Subject: fix askAmp X-Git-Tag: v3.0.0~87^2~9 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/16ea2b8ca301b008e109528a96fd9ba12815b7a9 fix askAmp again... must have been something i missed before. this function wasn't complete. --- diff --git a/common/lfdemod.c b/common/lfdemod.c index cf11b25b..a6e979a2 100644 --- a/common/lfdemod.c +++ b/common/lfdemod.c @@ -260,11 +260,14 @@ int cleanAskRawDemod(uint8_t *BinStream, size_t *size, int clk, int invert, int //by marshmellow void askAmp(uint8_t *BitStream, size_t size) { + uint8_t Last = 128; for(size_t i = 1; i=30) //large jump up - BitStream[i]=255; - else if(BitStream[i]-BitStream[i-1]<=-20) //large jump down - BitStream[i]=0; + Last = 255; + else if(BitStream[i-1]-BitStream[i]>=20) //large jump down + Last = 0; + + BitStream[i-1] = Last; } return; }