-
- LED_A_ON();
- LED_B_OFF();
- LED_C_OFF();
-
- while (true) {
- if(!iso14443a_select_card(uid, NULL, &cuid)) {
- if (MF_DBGLEVEL >= 1) Dbprintf("Can't select card");
- break;
- };
- for(int sec=0;sec<16;sec++){
- if(mifare_ultra_readblock(cuid, sectorNo * 4 + sec, dataoutbuf + 4 * sec)) {
- if (MF_DBGLEVEL >= 1) Dbprintf("Read block %d error",sec);
- break;
- };
- }
- if(mifare_ultra_halt(cuid)) {
- if (MF_DBGLEVEL >= 1) Dbprintf("Halt error");
- break;
- };
-
- isOK = 1;
- break;
- }
-
- if (MF_DBGLEVEL >= 2) DbpString("READ CARD FINISHED");
-
- // add trace trailer
- memset(uid, 0x44, 4);
- LogTrace(uid, 4, 0, 0, TRUE);
-
- LED_B_ON();
- cmd_send(CMD_ACK,isOK,0,0,dataoutbuf,64);
- //cmd_send(CMD_ACK,isOK,0,0,dataoutbuf+32, 32);
- LED_B_OFF();
-
- // Thats it...
- FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
- LEDsoff();
-// iso14a_set_tracing(TRUE);
-
-}
-
-
-//-----------------------------------------------------------------------------
-// Select, Authenticaate, Read an MIFARE tag.
-// read block
+\r
+ LED_A_ON();\r
+ LED_B_OFF();\r
+ LED_C_OFF();\r
+\r
+ while (true) {\r
+ if(!iso14443a_select_card(uid, NULL, &cuid)) {\r
+ if (MF_DBGLEVEL >= 1) Dbprintf("Can't select card");\r
+ break;\r
+ };\r
+ for(int sec=0;sec<16;sec++){\r
+ if(mifare_ultra_readblock(cuid, sectorNo * 4 + sec, dataoutbuf + 4 * sec)) {\r
+ if (MF_DBGLEVEL >= 1) Dbprintf("Read block %d error",sec);\r
+ break;\r
+ };\r
+ }\r
+ if(mifare_ultra_halt(cuid)) {\r
+ if (MF_DBGLEVEL >= 1) Dbprintf("Halt error");\r
+ break;\r
+ };\r
+\r
+ isOK = 1;\r
+ break;\r
+ }\r
+ \r
+ if (MF_DBGLEVEL >= 2) DbpString("READ CARD FINISHED");\r
+\r
+ // add trace trailer\r
+ memset(uid, 0x44, 4);\r
+ LogTrace(uid, 4, 0, 0, TRUE);\r
+ \r
+ LED_B_ON();\r
+ cmd_send(CMD_ACK,isOK,0,0,dataoutbuf,64);\r
+ //cmd_send(CMD_ACK,isOK,0,0,dataoutbuf+32, 32);\r
+ LED_B_OFF();\r
+\r
+ // Thats it...\r
+ FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);\r
+ LEDsoff();\r
+// iso14a_set_tracing(TRUE);\r
+\r
+}\r
+\r
+\r
+//-----------------------------------------------------------------------------\r
+// Select, Authenticaate, Read an MIFARE tag. \r
+// read block\r