Commit graph

6 commits

Author SHA1 Message Date
iceman1001 fabef615ec CHG: added addresize to legic select struct.
CHG: TIMER, it turns out the TC0, TC1 and TC2 is only 16bit.  So adjust to use two clocks to get a 32bit timer.
CHG: code clean up in legic device side.  consistency with variable names..
2016-09-29 17:43:39 +02:00
iceman1001 d7e24e7c5f CHG: 'hf list legic' doesn't print the parity now.
CHG: 'hf legic read' the device side timings is starting to look much better. HUGE Thanks to @will-rbnt for endless checks and logic analyser feedback. Without his effort this would not work. What does work? We can now use ANY IV in legic. The PM3 Master version is flawed, will only work with IV=0x55.

---still broke--- my crc implementation.. I know I'm about to look into it.
2016-09-28 21:37:08 +02:00
iceman1001 d5bded10e2 CHG: lowered the timout again, but re-added the spindelay since 14a requires 5ms powerup before entering the idle-state where tag starts to listen.
CHG: fix the ticks compare xx > 1 into  xx >= 1
2016-09-23 23:23:17 +02:00
iceman1001 f885043422 FIX: "hf 14a read" / "hf mf *" / "hf mfdes info" and failure when calling these commands serveral times in row.
For long transactions the sspclock compare with >1 instead of >=1 ..   Now the timer resets properly.
CHG: use some #define constants for iso-commands.
2016-09-23 21:28:07 +02:00
iceman1001 24c49d36ba FIX: This commit fixes the broken LF since I change the spindelay calls. The original problem is that spindelayus calls is incremented with21.3us each step, making it very hard to find exact timings found in the datasheets for T55x7, HID etcetc. When @marshmellow and I looked into this 2014, I had this on my back of my mind but forgot it since I didn't know how the source code / pm3 worked. This behavior in spindelayus has given the bit-period for ON/OFF measured in (us) very hard to find. Its kind of magic that it worked so far so good. Well until I started to look into the "hf legic" bitbanging ASK ON/OFF keying and that one needs a much more precis timer. Same goes for the PCF7931 code.
I've added a precise timer in the new files ticks.c and moved some older stuff from util.c to have a solid base for this.
UNTESTED,  and the timings measured for t55x7 in lfops.c and other parts has not been adjusted to this "correct" timer.
2016-09-23 16:35:26 +02:00
iceman1001 22f4dca88c CHG: extracted some timers functionality, to get unified access to a timer/clock which counts in ticks. Moved stuff from util.c 2016-09-21 19:03:32 +02:00