Added timing analysis based on how long it takes to receive all bytes.

This commit is contained in:
Dom 2018-03-30 09:28:39 +01:00
commit 7a5acc71ac
2 changed files with 6 additions and 1 deletions

View file

@ -2015,6 +2015,7 @@ void ReaderIso14443a(UsbCommand *c)
byte_t buf[USB_CMD_DATA_SIZE] = {0};
uint8_t par[MAX_PARITY_SIZE];
bool cantSELECT = false;
uint32_t start_ts = 0, end_ts = 0;
set_tracing(true);
@ -2091,7 +2092,11 @@ void ReaderIso14443a(UsbCommand *c)
ReaderTransmit(cmd,len, NULL); // 8 bits, odd parity
}
}
start_ts = GetCountSspClk(); //started just after we send all our bytes to the PICC
arg0 = ReaderReceive(buf, par);
end_ts = GetCountSspClk(); //ended just after we have received all the response bytes from the PICC.
uint32_t cycles_taken = end_ts - start_ts;
Dbprintf("Cycles taken to receive response from sending those bytes = %d", cycles_taken);
LED_B_ON();
cmd_send(CMD_ACK,arg0,0,0,buf,sizeof(buf));

View file

@ -20,7 +20,7 @@ OBJDIR = obj
LDLIBS = -L/opt/local/lib -L/usr/local/lib -lreadline -lpthread -lm
LUALIB = ../liblua/liblua.a
LDFLAGS = $(ENV_LDFLAGS)
CFLAGS = $(ENV_CFLAGS) -std=c99 -D_ISOC99_SOURCE -I. -I../include -I../common -I../common/polarssl -I../zlib -I../uart -I/opt/local/include -I../liblua -Wall -g -O3
CFLAGS = $(ENV_CFLAGS) -std=c99 -D_ISOC99_SOURCE -I. -I../include -I../common -I../common/polarssl -I../zlib -I../uart -I/opt/local/include -I../liblua -Wall -g -O3 -Wa,-q,-mavx512f
CXXFLAGS = -I../include -Wall -O3
LUAPLATFORM = generic