mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-08 09:10:06 +08:00
@marshmellow42 's fix askAMP 16ea2b8ca3
This commit is contained in:
parent
f3cbb7bc7b
commit
9686a8d4d5
1 changed files with 8 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue