From dc22ba144ce62f56719f78834ec30b994bc16cb1 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 21 Feb 2018 14:52:31 +0100 Subject: [PATCH] fix: adapting for g_debug access.. --- client/graph.h | 2 ++ client/proxgui.h | 5 +++-- client/ui.c | 7 +++---- client/ui.h | 1 + 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/client/graph.h b/client/graph.h index 50e3b70d5..ec6011c27 100644 --- a/client/graph.h +++ b/client/graph.h @@ -33,7 +33,9 @@ void save_restoreGB(uint8_t saveOpt); bool HasGraphData(); // Max graph trace len: 40000 (bigbuf) * 8 (at 1 bit per sample) +#ifndef MAX_GRAPH_TRACE_LEN #define MAX_GRAPH_TRACE_LEN (40000 * 8 ) +#endif #define GRAPH_SAVE 1 #define GRAPH_RESTORE 0 diff --git a/client/proxgui.h b/client/proxgui.h index c1c826eb5..cee7b931b 100644 --- a/client/proxgui.h +++ b/client/proxgui.h @@ -21,8 +21,9 @@ void RepaintGraphWindow(void); void MainGraphics(void); void InitGraphics(int argc, char **argv, char *script_cmds_file, char *script_cmd, bool usb_present); void ExitGraphics(void); - +#ifndef MAX_GRAPH_TRACE_LEN #define MAX_GRAPH_TRACE_LEN (40000 * 8) +#endif extern int GraphBuffer[MAX_GRAPH_TRACE_LEN]; extern int GraphTraceLen; extern int s_Buff[MAX_GRAPH_TRACE_LEN]; @@ -45,7 +46,7 @@ extern void save_restoreGB(uint8_t saveOpt); #define MAX_DEMOD_BUF_LEN (1024*128) extern uint8_t DemodBuffer[MAX_DEMOD_BUF_LEN]; extern size_t DemodBufferLen; -extern size_t g_DemodStartIdx; +//extern size_t g_DemodStartIdx; extern bool showDemod; extern uint8_t g_debugMode; diff --git a/client/ui.c b/client/ui.c index 216967e90..d5d808a22 100644 --- a/client/ui.c +++ b/client/ui.c @@ -24,10 +24,10 @@ static char *logfilename = "proxmark3.log"; void PrintAndLogEx(logLevel_t level, char *fmt, ...) { char buffer[MAX_PRINT_BUFFER] = {0}; - int size; + int size = 0; static char *prefix[7] = { "", "[+] ", "[=] ", "[-] ", "[!] ", "[!!] ", "[#] "}; - if (g_debugMode == 0 && level == logLevel.DEBUG) { + if (g_debugMode == 0 && level == DEBUG) { // skip debug messages if client debugging is turned off i.e. 'DATA SETDEBUG 0' } else { @@ -183,8 +183,7 @@ void iceSimple_Filter(int *data, const size_t len, uint8_t k){ } } -float complex cexpf (float complex Z) -{ +float complex cexpf (float complex Z) { float complex Res; double rho = exp (__real__ Z); __real__ Res = rho * cosf(__imag__ Z); diff --git a/client/ui.h b/client/ui.h index 83669d1d1..22cc38a3a 100644 --- a/client/ui.h +++ b/client/ui.h @@ -24,6 +24,7 @@ #include "util.h" #include "cmdmain.h" +#include "proxgui.h" #ifndef M_PI #define M_PI 3.14159265358979323846264338327