mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-19 12:59:44 -07:00
Minor refactoring
This commit is contained in:
parent
aeadbdb216
commit
03dc174036
1 changed files with 7 additions and 13 deletions
|
@ -154,7 +154,7 @@ static struct {
|
||||||
static int Handle14443UartBit(int bit)
|
static int Handle14443UartBit(int bit)
|
||||||
{
|
{
|
||||||
switch(Uart.state) {
|
switch(Uart.state) {
|
||||||
case STATE_UNSYNCD:
|
case STATE_UNSYNCD:
|
||||||
LED_A_OFF();
|
LED_A_OFF();
|
||||||
if(!bit) {
|
if(!bit) {
|
||||||
// we went low, so this could be the beginning
|
// we went low, so this could be the beginning
|
||||||
|
@ -1045,12 +1045,6 @@ void RAMFUNC SnoopIso14443(void)
|
||||||
clear_trace();
|
clear_trace();
|
||||||
set_tracing(TRUE);
|
set_tracing(TRUE);
|
||||||
|
|
||||||
// The command (reader -> tag) that we're receiving.
|
|
||||||
uint8_t *receivedCmd = ((uint8_t *)BigBuf) + RECV_CMD_OFFSET;
|
|
||||||
|
|
||||||
// The response (tag -> reader) that we're receiving.
|
|
||||||
uint8_t *receivedResponse = ((uint8_t *)BigBuf) + RECV_RESP_OFFSET;
|
|
||||||
|
|
||||||
// The DMA buffer, used to stream samples from the FPGA.
|
// The DMA buffer, used to stream samples from the FPGA.
|
||||||
int8_t *dmaBuf = ((int8_t *)BigBuf) + DMA_BUFFER_OFFSET;
|
int8_t *dmaBuf = ((int8_t *)BigBuf) + DMA_BUFFER_OFFSET;
|
||||||
int lastRxCounter;
|
int lastRxCounter;
|
||||||
|
@ -1117,8 +1111,8 @@ void RAMFUNC SnoopIso14443(void)
|
||||||
|
|
||||||
if(Handle14443UartBit(ci & 1)) {
|
if(Handle14443UartBit(ci & 1)) {
|
||||||
if(triggered && tracing) {
|
if(triggered && tracing) {
|
||||||
GetParity(receivedCmd, Uart.byteCnt, parity);
|
GetParity(Uart.output, Uart.byteCnt, parity);
|
||||||
LogTrace(receivedCmd,Uart.byteCnt,samples, samples,parity,TRUE);
|
LogTrace(Uart.output,Uart.byteCnt,samples, samples,parity,TRUE);
|
||||||
}
|
}
|
||||||
/* And ready to receive another command. */
|
/* And ready to receive another command. */
|
||||||
UartReset();
|
UartReset();
|
||||||
|
@ -1128,8 +1122,8 @@ void RAMFUNC SnoopIso14443(void)
|
||||||
}
|
}
|
||||||
if(Handle14443UartBit(cq & 1)) {
|
if(Handle14443UartBit(cq & 1)) {
|
||||||
if(triggered && tracing) {
|
if(triggered && tracing) {
|
||||||
GetParity(receivedCmd, Uart.byteCnt, parity);
|
GetParity(Uart.output, Uart.byteCnt, parity);
|
||||||
LogTrace(receivedCmd,Uart.byteCnt,samples, samples,parity,TRUE);
|
LogTrace(Uart.output,Uart.byteCnt,samples, samples,parity,TRUE);
|
||||||
}
|
}
|
||||||
/* And ready to receive another command. */
|
/* And ready to receive another command. */
|
||||||
UartReset();
|
UartReset();
|
||||||
|
@ -1144,8 +1138,8 @@ void RAMFUNC SnoopIso14443(void)
|
||||||
if(tracing)
|
if(tracing)
|
||||||
{
|
{
|
||||||
uint8_t parity[MAX_PARITY_SIZE];
|
uint8_t parity[MAX_PARITY_SIZE];
|
||||||
GetParity(receivedResponse, Demod.len, parity);
|
GetParity(Demod.output, Demod.len, parity);
|
||||||
LogTrace(receivedResponse,Demod.len,samples, samples,parity,FALSE);
|
LogTrace(Demod.output,Demod.len,samples, samples,parity,FALSE);
|
||||||
}
|
}
|
||||||
triggered = TRUE;
|
triggered = TRUE;
|
||||||
LED_A_OFF();
|
LED_A_OFF();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue