@marshmellow42 's fix askAMP 16ea2b8ca3

This commit is contained in:
iceman1001 2016-06-20 13:21:36 +02:00
parent f3cbb7bc7b
commit 9686a8d4d5

View file

@ -259,13 +259,15 @@ int cleanAskRawDemod(uint8_t *BinStream, size_t *size, int clk, int invert, int
//by marshmellow
void askAmp(uint8_t *BitStream, size_t size)
{
for(size_t i = 1; i<size; i++){
if (BitStream[i]-BitStream[i-1]>=30) //large jump up
BitStream[i]=255;
else if(BitStream[i]-BitStream[i-1]<=-20) //large jump down
BitStream[i]=0;
uint8_t last = 128;
for(size_t i = 1; i < size; ++i){
if (BitStream[i]-BitStream[i-1] >= 30) //large jump up
last = 255;
else if(BitStream[i-1] - BitStream[i] >= 20) //large jump down
last = 0;
BitStream[i] = last;
}
return;
}
//by marshmellow