mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-19 21:03:23 -07:00
lf demod cleanup nrz clock detect fixes
slight adjustment to lf t55xx sampling code to start at the same spot more consistently reduce indala detection false positives lf t55xx commands heavily tested and seem to be stable and reliable on most modulations/bitrates (excluding Sequence Terminator configured cards).
This commit is contained in:
parent
93507a3375
commit
6fe5c94bda
6 changed files with 119 additions and 118 deletions
|
@ -255,7 +255,8 @@ uint32_t SnoopLF()
|
|||
**/
|
||||
void doT55x7Acquisition(size_t sample_size) {
|
||||
|
||||
#define T55xx_READ_UPPER_THRESHOLD 128+40 // 40 grph
|
||||
#define T55xx_READ_UPPER_THRESHOLD 128+60 // 60 grph
|
||||
#define T55xx_READ_LOWER_THRESHOLD 128-60 // -60 grph
|
||||
#define T55xx_READ_TOL 5
|
||||
|
||||
uint8_t *dest = BigBuf_get_addr();
|
||||
|
@ -267,6 +268,7 @@ void doT55x7Acquisition(size_t sample_size) {
|
|||
uint16_t i = 0;
|
||||
bool startFound = false;
|
||||
bool highFound = false;
|
||||
bool lowFound = false;
|
||||
uint8_t curSample = 0;
|
||||
uint8_t lastSample = 0;
|
||||
uint16_t skipCnt = 0;
|
||||
|
@ -282,15 +284,26 @@ void doT55x7Acquisition(size_t sample_size) {
|
|||
|
||||
// skip until the first high sample above threshold
|
||||
if (!startFound && curSample > T55xx_READ_UPPER_THRESHOLD) {
|
||||
if (curSample > lastSample)
|
||||
lastSample = curSample;
|
||||
//if (curSample > lastSample)
|
||||
// lastSample = curSample;
|
||||
highFound = true;
|
||||
} else if (!highFound) {
|
||||
skipCnt++;
|
||||
continue;
|
||||
}
|
||||
// skip until the first Low sample below threshold
|
||||
if (!startFound && curSample < T55xx_READ_LOWER_THRESHOLD) {
|
||||
//if (curSample > lastSample)
|
||||
lastSample = curSample;
|
||||
lowFound = true;
|
||||
} else if (!lowFound) {
|
||||
skipCnt++;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// skip until first high samples begin to change
|
||||
if (startFound || curSample < T55xx_READ_UPPER_THRESHOLD-T55xx_READ_TOL){
|
||||
if (startFound || curSample > T55xx_READ_LOWER_THRESHOLD+T55xx_READ_TOL){
|
||||
// if just found start - recover last sample
|
||||
if (!startFound) {
|
||||
dest[i++] = lastSample;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue