Uart.bitCnt = 0;
Uart.shiftReg = 0;
Uart.state = STATE_RECEIVING_DATA;
- LED_A_ON(); // Indicate we're receiving
}
break;
Uart.posCnt++;
if(Uart.posCnt > 10) {
Uart.state = STATE_UNSYNCD;
+ LED_A_OFF();
}
break;
break;
}
- if (Uart.state == STATE_UNSYNCD) LED_A_OFF();
-
return FALSE;
}
} else {
if(Demod.posCount > 100) {
Demod.state = DEMOD_UNSYNCD;
+ LED_C_OFF();
}
}
Demod.posCount++;
if(v > 0) {
if(Demod.posCount > 10) {
Demod.state = DEMOD_UNSYNCD;
+ LED_C_OFF();
}
} else {
Demod.bitCount = 0;
Demod.output[Demod.len] = b;
Demod.len++;
Demod.state = DEMOD_AWAITING_START_BIT;
- } else if(s == 0x000) {
- // This is EOF
- LED_C_OFF();
- Demod.state = DEMOD_UNSYNCD;
- return TRUE;
} else {
Demod.state = DEMOD_UNSYNCD;
+ LED_C_OFF();
+ if(s == 0x000) {
+ // This is EOF
+ return TRUE;
+ }
}
}
Demod.posCount = 0;
default:
Demod.state = DEMOD_UNSYNCD;
+ LED_C_OFF();
break;
}
- if (Demod.state == DEMOD_UNSYNCD) LED_C_OFF(); // Not synchronized...
return FALSE;
}
}
if(!ReaderIsActive) { // no need to try decoding tag data if the reader is sending - and we cannot afford the time
- if(Handle14443SamplesDemod(ci, cq)) {
+ if(Handle14443SamplesDemod(ci & 0xFE, cq & 0xFE)) {
//Use samples as a time measurement
if(tracing)
{
uint8_t parity[MAX_PARITY_SIZE];
GetParity(Demod.output, Demod.len, parity);
- LogTrace(Demod.output, Demod.len,samples, samples, parity, FALSE);
+ LogTrace(Demod.output, Demod.len, samples, samples, parity, FALSE);
}
triggered = TRUE;
LED_A_OFF();