]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
CHG: making timings a bit tighter == faster read of tag. Like 1ms for whole tag.
authoriceman1001 <iceman@iuse.se>
Tue, 4 Oct 2016 21:08:39 +0000 (23:08 +0200)
committericeman1001 <iceman@iuse.se>
Tue, 4 Oct 2016 21:08:39 +0000 (23:08 +0200)
FIX:  off-by-one bug in read-byte-loop.

armsrc/legicrf.c
client/cmdhflegic.c

index 2d02b636fc2cea8af8b1b28262dbcc33d7567b72..1b068404296892aee0eb1fd74cef54cb4af326d3 100644 (file)
@@ -395,8 +395,10 @@ int legic_read_byte( uint16_t index, uint8_t cmd_sz) {
        uint8_t byte, crc, calcCrc = 0;
        uint32_t cmd = (index << 1) | LEGIC_READ;
 
-       //WaitTicks(366); 
-       WaitTicks(330); 
+       //WaitTicks(330); // (4)
+       WaitTicks(240); // (3)
+       //WaitTicks(230); //(2)
+       //WaitTicks(60); //(1)
        
        frame_sendAsReader(cmd, cmd_sz);
        frame_receiveAsReader(&current_frame, 12);
@@ -411,7 +413,7 @@ int legic_read_byte( uint16_t index, uint8_t cmd_sz) {
                return -1;
        }
 
-       legic_prng_forward(4);
+       legic_prng_forward(3);
        return byte;
 }
 
@@ -505,7 +507,7 @@ int LegicRfReader(uint16_t offset, uint16_t len, uint8_t iv) {
        setup_phase_reader(iv);
                
        LED_B_ON();
-       while (i <= len) {
+       while (i < len) {
                int r = legic_read_byte(offset + i, card.cmdsize);
                
                if (r == -1 || BUTTON_PRESS()) {                        
index 376ec40fbaea427ad68fe4795b849a0aad326422..6b880da69281c7bf20df0a4ddb463cd306b7ebbb 100644 (file)
@@ -440,8 +440,8 @@ int CmdLegicRFRead(const char *Cmd) {
                                return 1;
                        }
        
-                       PrintAndLog("\nData");
-                       PrintAndLog("-----------------------------");
+                       PrintAndLog("\n ##  | Data");
+                       PrintAndLog("-----+-----");
                        print_hex_break( data, readlen, 32);
                 } else {
                         PrintAndLog("failed reading tag");
Impressum, Datenschutz