+ uint32_t tag_type = perform_setup_phase_rwd(0x55);
+ switch(tag_type) {
+ case 0x1d:
+ DbpString("MIM 256 card found, reading card ...");
+ cmd_sz = 9;
+ card_sz = 256;
+ break;
+ case 0x3d:
+ DbpString("MIM 1024 card found, reading card ...");
+ cmd_sz = 11;
+ card_sz = 1024;
+ break;
+ default:
+ Dbprintf("No or unknown card found, aborting");
+ switch_off_tag_rwd();
+ return;
+ }
+ if(bytes == -1) {
+ bytes = card_sz;
+ }
+ if(bytes+offset >= card_sz) {
+ bytes = card_sz-offset;
+ }
+
+ switch_off_tag_rwd(); //we lost to mutch time with dprintf