]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - common/lfdemod.c
fixes #85
[proxmark3-svn] / common / lfdemod.c
index 93c677868b4908731e7ad8f12ef7c1e9d23033f0..797bce40638e805cbffd55ec43a7da312b52b187 100644 (file)
@@ -14,21 +14,20 @@ void dummy(char *fmt, ...){}
 void dummy_sgc (int clock, int startidx) {}
 
 #ifndef ON_DEVICE
-# include "ui.h"
+# include "ui.h"                // plotclock, plotclockstartindex
 # include "cmdparser.h"
 # include "cmddata.h"
 # define prnt PrintAndLog
 # define sgc SetGraphClock
-#else 
-  uint8_t g_debugMode=0;
-# define prnt dummy
-# define sgc dummy_sgc
-#endif
-
 void SetGraphClock(int clock, int startidx){
        PlotClock = clock;
        PlockClockStartIndex = startidx;        
 }
+#else 
+  uint8_t g_debugMode = 0;
+# define prnt dummy
+# define sgc dummy_sgc
+#endif
 
 //test samples are not just noise
 uint8_t justNoise(uint8_t *bits, size_t size) {
@@ -946,9 +945,10 @@ int DetectStrongAskClock(uint8_t dest[], size_t size, uint8_t high, uint8_t low,
        // set clock
        if (g_debugMode==2) prnt("DEBUG ASK: detectstrongASKclk smallest wave: %d",minClk);
        for (uint8_t clkCnt = 0; clkCnt<7; clkCnt++) {
-               if (minClk >= clocks[clkCnt]-(clocks[clkCnt]/8) && minClk <= clocks[clkCnt]+1)
+               if (minClk >= clocks[clkCnt]-(clocks[clkCnt]/8) && minClk <= clocks[clkCnt]+1) {
                        *clock = clocks[clkCnt];
                        return shortestWaveIdx;
+               }
        }
        return 0;
 }
Impressum, Datenschutz