mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-14 02:26:59 -07:00
adjust pskdemod
add skipped bits before first phase back in PSKDemod now returns 1 for success or 0 for fail like other demods
This commit is contained in:
parent
e74fc2ecba
commit
7a8a982bde
2 changed files with 31 additions and 32 deletions
|
@ -1079,7 +1079,9 @@ void psk1TOpsk2(uint8_t *BitStream, size_t size)
|
|||
size_t i=1;
|
||||
uint8_t lastBit=BitStream[0];
|
||||
for (; i<size; i++){
|
||||
if (lastBit!=BitStream[i]){
|
||||
if (BitStream[i]==77){
|
||||
//ignore errors
|
||||
} else if (lastBit!=BitStream[i]){
|
||||
lastBit=BitStream[i];
|
||||
BitStream[i]=1;
|
||||
} else {
|
||||
|
@ -1619,10 +1621,13 @@ int pskRawDemod(uint8_t dest[], size_t *size, int *clock, int *invert)
|
|||
}
|
||||
//PrintAndLog("DEBUG: firstFullWave: %d, waveLen: %d",firstFullWave,fullWaveLen);
|
||||
lastClkBit = firstFullWave; //set start of wave as clock align
|
||||
//PrintAndLog("DEBUG: clk: %d, lastClkBit: %d", *clock, lastClkBit);
|
||||
waveStart = 0;
|
||||
errCnt=0;
|
||||
size_t numBits=0;
|
||||
//PrintAndLog("DEBUG: clk: %d, lastClkBit: %d", *clock, lastClkBit);
|
||||
//set skipped bits
|
||||
memset(dest+numBits,curPhase^1,firstFullWave / *clock);
|
||||
numBits += (firstFullWave / *clock);
|
||||
dest[numBits++] = curPhase; //set first read bit
|
||||
for (i = firstFullWave+fullWaveLen-1; i < *size-3; i++){
|
||||
//top edge of wave = start of new wave
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue