]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlfem4x.c
fix y grid +
[proxmark3-svn] / client / cmdlfem4x.c
index 83a7da4e3eb0a156383608cd6eff8f7703a7361a..4e0ada5720b212509a8b9c686053a6d6e1f3f8e7 100644 (file)
@@ -153,7 +153,8 @@ int AskEm410xDecode(bool verbose, uint32_t *hi, uint64_t *lo )
        if (Em410xDecode(BitStream, &BitLen, &idx, hi, lo)) {
                //set GraphBuffer for clone or sim command
                setDemodBuf(DemodBuffer, (BitLen==40) ? 64 : 128, idx+1);
-               g_DemodStartIdx += (idx+1)*g_DemodClock;
+               setClockGrid(g_DemodClock, g_DemodStartIdx + ((idx+1)*g_DemodClock));
+
                if (g_debugMode) {
                        PrintAndLog("DEBUG: idx: %d, Len: %d, Printing Demod Buffer:", idx, BitLen);
                        printDemodBuff();
@@ -473,9 +474,6 @@ int EM4x50Read(const char *Cmd, bool verbose)
        // get user entry if any
        sscanf(Cmd, "%i %i", &clk, &invert);
        
-       // save GraphBuffer - to restore it later       
-       save_restoreGB(1);
-
        // first get high and low values
        for (i = 0; i < GraphTraceLen; i++) {
                if (GraphBuffer[i] > high)
@@ -572,6 +570,8 @@ int EM4x50Read(const char *Cmd, bool verbose)
        } else if (start < 0) return 0;
        start = skip;
        snprintf(tmp2, sizeof(tmp2),"%d %d 1000 %d", clk, invert, clk*47);
+       // save GraphBuffer - to restore it later       
+       save_restoreGB(1);
        // get rid of leading crap 
        snprintf(tmp, sizeof(tmp), "%i", skip);
        CmdLtrim(tmp);
@@ -704,6 +704,8 @@ bool EM4x05testDemodReadData(uint32_t *word, bool readCmd) {
                }
 
                setDemodBuf(DemodBuffer, 32, 0);
+               //setClockGrid(0,0);
+
                *word = bytebits_to_byteLSBF(DemodBuffer, 32);
        }
        return true;
Impressum, Datenschutz