#include "../common/crc.h"\r
\r
//-----------------------------------------------------------------------------\r
-// Select, Authenticaate, Read an MIFARE tag. \r
+// Select, Authenticate, Read a MIFARE tag. \r
// read block\r
//-----------------------------------------------------------------------------\r
void MifareReadBlock(uint8_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain)\r
\r
void MifareUReadCard(uint8_t arg0, int arg1, uint8_t *datain)\r
{\r
- // params\r
- uint8_t sectorNo = arg0;\r
- int Pages=arg1;\r
+ // params\r
+ uint8_t sectorNo = arg0;\r
+ int Pages=arg1;\r
int count_Pages=0;\r
- // variables\r
- byte_t isOK = 0;\r
- byte_t dataoutbuf[44 * 4];\r
- uint8_t uid[10];\r
- uint32_t cuid;\r
+ // variables\r
+ byte_t isOK = 0;\r
+ byte_t dataoutbuf[176];\r
+ uint8_t uid[10];\r
+ uint32_t cuid;\r
\r
- // clear trace\r
- iso14a_clear_trace();\r
+ // clear trace\r
+ iso14a_clear_trace();\r
\r
- iso14443a_setup(FPGA_HF_ISO14443A_READER_LISTEN);\r
+ iso14443a_setup(FPGA_HF_ISO14443A_READER_LISTEN);\r
\r
- LED_A_ON();\r
- LED_B_OFF();\r
- LED_C_OFF();\r
- Dbprintf("Pages %d",Pages);\r
+ LED_A_ON();\r
+ LED_B_OFF();\r
+ LED_C_OFF();\r
+ Dbprintf("Pages %d",Pages);\r
while (true) {\r
if(!iso14443a_select_card(uid, NULL, &cuid)) {\r
if (MF_DBGLEVEL >= 1) Dbprintf("Can't select card");\r
isOK = 1;\r
break;\r
}\r
- Dbprintf("Pages read %d",count_Pages);\r
- if (MF_DBGLEVEL >= 2) DbpString("READ CARD FINISHED");\r
+ Dbprintf("Pages read %d",count_Pages);\r
+ if (MF_DBGLEVEL >= 2) DbpString("READ CARD FINISHED");\r
\r
LED_B_ON();\r
if (Pages==16) cmd_send(CMD_ACK,isOK,0,0,dataoutbuf,64);\r
if (Pages==44 && count_Pages>16) cmd_send(CMD_ACK,isOK,0,0,dataoutbuf,176);\r
LED_B_OFF();\r
\r
- // Thats it...\r
- FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);\r
- LEDsoff();\r
+ // Thats it...\r
+ FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);\r
+ LEDsoff();\r
\r
}\r
\r
cmd_send(CMD_ACK,isOK,0,0,datain + i * 6,6);\r
LED_B_OFF();\r
\r
- // Thats it...\r
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);\r
LEDsoff();\r
\r
LED_B_OFF();\r
\r
if ((workFlags & 0x10) || (!isOK)) {\r
- // Thats it...\r
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);\r
LEDsoff();\r
}\r