]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
FIX: moved from lfdemod.c -> graph.c SetGraphClock.
authoriceman1001 <iceman@iuse.se>
Thu, 2 Mar 2017 20:15:01 +0000 (21:15 +0100)
committericeman1001 <iceman@iuse.se>
Thu, 2 Mar 2017 20:15:01 +0000 (21:15 +0100)
client/graph.c
common/lfdemod.c

index a0ba46d5b86432a3630fcc22c4754949086a303c..91fecff862c9189245f2e33e84e8a3def949e981 100644 (file)
@@ -123,6 +123,11 @@ void DetectHighLowInGraph(int *high, int *low, bool addFuzz) {
        }
 }
 
+void SetGraphClock( int clock, int startidx){
+       PlotClock = clock;
+       PlockClockStartIndex = startidx;        
+}
+
 // Get or auto-detect ask clock rate
 int GetAskClock(const char str[], bool printAns, bool verbose)
 {
@@ -149,6 +154,7 @@ int GetAskClock(const char str[], bool printAns, bool verbose)
        // Only print this message if we're not looping something
        if (printAns)
                PrintAndLog("Auto-detected clock rate: %d, Best Starting Position: %d", clock, start);
+       SetGraphClock(clock, start);
        return clock;
 }
 
index 61d01c27588f93bdeab20ef70a5e1b77d6b91dec..fddc624a086442538d6c01ae0ddcb2a8ee6f5421 100644 (file)
@@ -940,10 +940,6 @@ int DetectStrongAskClock(uint8_t dest[], size_t size, uint8_t high, uint8_t low)
        }
        return 0;
 }
-void SetGraphClock( int clock, int startidx){
-       PlotClock = clock;
-       PlockClockStartIndex = startidx;        
-}
 
 // by marshmellow
 // not perfect especially with lower clocks or VERY good antennas (heavy wave clipping)
@@ -1030,8 +1026,6 @@ int DetectASKClock(uint8_t dest[], size_t size, int *clock, int maxErr)
                        if (g_debugMode == 2) prnt("DEBUG ASK: clk %d, err %d, startpos %d, endpos %d", clk[clkCnt], errCnt, ii, i);
                        if (errCnt==0 && clkCnt<7) { 
                                if (!clockFnd) *clock = clk[clkCnt];
-                               
-                               SetGraphClock(*clock, ii);
                                return ii;
                        }
                        //if we found errors see if it is lowest so far and save it as best run
@@ -1055,7 +1049,6 @@ int DetectASKClock(uint8_t dest[], size_t size, int *clock, int maxErr)
        }
        if (!clockFnd) *clock = clk[best];
        
-       SetGraphClock(*clock, bestStart[best]);
        return bestStart[best];
 }
 
Impressum, Datenschutz