From: iceman1001 Date: Thu, 2 Mar 2017 20:15:01 +0000 (+0100) Subject: FIX: moved from lfdemod.c -> graph.c SetGraphClock. X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/1ec412d97ddac6bd184c645815037e29fd84fb90 FIX: moved from lfdemod.c -> graph.c SetGraphClock. --- diff --git a/client/graph.c b/client/graph.c index a0ba46d5..91fecff8 100644 --- a/client/graph.c +++ b/client/graph.c @@ -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; } diff --git a/common/lfdemod.c b/common/lfdemod.c index 61d01c27..fddc624a 100644 --- a/common/lfdemod.c +++ b/common/lfdemod.c @@ -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]; }