more adaptations
This commit is contained in:
@@ -14,9 +14,13 @@
|
||||
#include "ui.h"
|
||||
#include "graph.h"
|
||||
#include "lfdemod.h"
|
||||
#include "cmddata.h" //for g_debugmode
|
||||
|
||||
int GraphBuffer[MAX_GRAPH_TRACE_LEN];
|
||||
int GraphTraceLen;
|
||||
|
||||
int s_Buff[MAX_GRAPH_TRACE_LEN];
|
||||
|
||||
/* write a manchester bit to the graph */
|
||||
void AppendGraph(int redraw, int clock, int bit)
|
||||
{
|
||||
@@ -46,16 +50,19 @@ int ClearGraph(int redraw)
|
||||
void save_restoreGB(uint8_t saveOpt)
|
||||
{
|
||||
static int SavedGB[MAX_GRAPH_TRACE_LEN];
|
||||
static int SavedGBlen;
|
||||
static int SavedGBlen=0;
|
||||
static bool GB_Saved = false;
|
||||
static int SavedGridOffsetAdj=0;
|
||||
|
||||
if (saveOpt==1) { //save
|
||||
if (saveOpt == GRAPH_SAVE) { //save
|
||||
memcpy(SavedGB, GraphBuffer, sizeof(GraphBuffer));
|
||||
SavedGBlen = GraphTraceLen;
|
||||
GB_Saved=true;
|
||||
SavedGridOffsetAdj = GridOffset;
|
||||
} else if (GB_Saved){ //restore
|
||||
memcpy(GraphBuffer, SavedGB, sizeof(GraphBuffer));
|
||||
GraphTraceLen = SavedGBlen;
|
||||
GridOffset = SavedGridOffsetAdj;
|
||||
RepaintGraphWindow();
|
||||
}
|
||||
return;
|
||||
@@ -147,7 +154,6 @@ int GetAskClock(const char str[], bool printAns, bool verbose)
|
||||
|
||||
if (printAns)
|
||||
PrintAndLog("Auto-detected clock rate: %d, Best Starting Position: %d", clock, start);
|
||||
SetGraphClock(clock, start);
|
||||
return clock;
|
||||
}
|
||||
|
||||
@@ -190,7 +196,6 @@ int GetPskClock(const char str[], bool printAns, bool verbose)
|
||||
if (printAns)
|
||||
PrintAndLog("Auto-detected clock rate: %d, Best Starting Position: %d", clock, start);
|
||||
|
||||
SetGraphClock(clock, start);
|
||||
return clock;
|
||||
}
|
||||
|
||||
@@ -217,7 +222,6 @@ uint8_t GetNrzClock(const char str[], bool printAns, bool verbose)
|
||||
if (printAns)
|
||||
PrintAndLog("Auto-detected clock rate: %d, Best Starting Position: %d", clock, start);
|
||||
|
||||
SetGraphClock(clock, start);
|
||||
return clock;
|
||||
}
|
||||
//by marshmellow
|
||||
@@ -263,9 +267,6 @@ uint8_t fskClocks(uint8_t *fc1, uint8_t *fc2, uint8_t *rf1, bool verbose)
|
||||
if (verbose || g_debugMode) PrintAndLog("DEBUG: Clock detect error");
|
||||
return 0;
|
||||
}
|
||||
if (verbose || g_debugMode)
|
||||
PrintAndLog("Detected Field Clocks: FC/%d, FC/%d - Bit Clock: RF/%d | Best Starting Position: %d", *fc1, *fc2, *rf1, start);
|
||||
SetGraphClock(*rf1, start);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,11 @@ void DetectHighLowInGraph(int *high, int *low, bool addFuzz);
|
||||
|
||||
// Max graph trace len: 40000 (bigbuf) * 8 (at 1 bit per sample)
|
||||
#define MAX_GRAPH_TRACE_LEN (40000 * 8 )
|
||||
#define GRAPH_SAVE 1
|
||||
#define GRAPH_RESTORE 0
|
||||
|
||||
extern int GraphBuffer[MAX_GRAPH_TRACE_LEN];
|
||||
extern int GraphTraceLen;
|
||||
extern int s_Buff[MAX_GRAPH_TRACE_LEN];
|
||||
|
||||
#endif
|
||||
|
||||
32
client/ui.c
32
client/ui.c
@@ -11,13 +11,14 @@
|
||||
|
||||
#include "ui.h"
|
||||
|
||||
// set QT vars
|
||||
double CursorScaleFactor;
|
||||
int PlotGridX, PlotGridY, PlotGridXdefault = 64, PlotGridYdefault = 64, CursorCPos = 0, CursorDPos = 0;
|
||||
int PlotClock = 0, PlockClockStartIndex = 0;
|
||||
|
||||
double CursorScaleFactor = 1;
|
||||
int PlotGridX=0, PlotGridY=0, PlotGridXdefault= 64, PlotGridYdefault= 64, CursorCPos= 0, CursorDPos= 0;
|
||||
int offline;
|
||||
int flushAfterWrite = 0;
|
||||
int flushAfterWrite = 0; //buzzy
|
||||
int GridOffset = 0;
|
||||
bool GridLocked = false;
|
||||
bool showDemod = true;
|
||||
|
||||
extern pthread_mutex_t print_lock;
|
||||
|
||||
static char *logfilename = "proxmark3.log";
|
||||
@@ -29,9 +30,6 @@ void PrintAndLog(char *fmt, ...)
|
||||
va_list argptr, argptr2;
|
||||
static FILE *logfile = NULL;
|
||||
static int logging = 1;
|
||||
// time_t current_time;
|
||||
// struct tm* tm_info;
|
||||
// char buffer[26] = {0};
|
||||
|
||||
// lock this section to avoid interlacing prints from different threads
|
||||
pthread_mutex_lock(&print_lock);
|
||||
@@ -44,6 +42,8 @@ void PrintAndLog(char *fmt, ...)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef RL_STATE_READCMD
|
||||
// We are using GNU readline.
|
||||
int need_hack = (rl_readline_state & RL_STATE_READCMD) > 0;
|
||||
|
||||
if (need_hack) {
|
||||
@@ -53,6 +53,10 @@ void PrintAndLog(char *fmt, ...)
|
||||
rl_replace_line("", 0);
|
||||
rl_redisplay();
|
||||
}
|
||||
#else
|
||||
// We are using libedit (OSX), which doesn't support this flag.
|
||||
int need_hack = 0;
|
||||
#endif
|
||||
|
||||
va_start(argptr, fmt);
|
||||
va_copy(argptr2, argptr);
|
||||
@@ -70,16 +74,6 @@ void PrintAndLog(char *fmt, ...)
|
||||
}
|
||||
|
||||
if (logging && logfile) {
|
||||
|
||||
/*
|
||||
// Obtain current time.
|
||||
current_time = time(NULL);
|
||||
// Convert to local time format.
|
||||
tm_info = localtime(¤t_time);
|
||||
strftime(buffer, 26, "%Y-%m-%d %H:%M:%S", tm_info);
|
||||
fprintf(logfile, "%s ", buffer);
|
||||
*/
|
||||
|
||||
vfprintf(logfile, fmt, argptr2);
|
||||
fprintf(logfile,"\n");
|
||||
fflush(logfile);
|
||||
|
||||
15
client/ui.h
15
client/ui.h
@@ -16,18 +16,12 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <readline/readline.h>
|
||||
#include <pthread.h>
|
||||
#include <math.h>
|
||||
#include <math.h>
|
||||
#include <complex.h>
|
||||
|
||||
// Handle platform specific includes
|
||||
#ifndef _WIN32
|
||||
#include <sys/time.h>
|
||||
#else
|
||||
#include <time.h>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "loclass/cipherutils.h"
|
||||
#include "util.h"
|
||||
@@ -45,10 +39,11 @@ void PrintAndLog(char *fmt, ...);
|
||||
void SetLogFilename(char *fn);
|
||||
|
||||
extern double CursorScaleFactor;
|
||||
extern int PlotGridX, PlotGridY, PlotGridXdefault, PlotGridYdefault, CursorCPos, CursorDPos;
|
||||
extern int PlotClock, PlockClockStartIndex;
|
||||
extern int PlotGridX, PlotGridY, PlotGridXdefault, PlotGridYdefault, CursorCPos, CursorDPos, GridOffset;
|
||||
extern int offline;
|
||||
extern int flushAfterWrite; //buzzy
|
||||
extern bool GridLocked;
|
||||
extern bool showDemod;
|
||||
|
||||
void iceIIR_Butterworth(int * data, const size_t len);
|
||||
void iceSimple_Filter(int *data, const size_t len, uint8_t k);
|
||||
|
||||
Reference in New Issue
Block a user