X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/a553f2674865fa544d04ca7b8194e30c008644ae..7c756d68925891ec3d3aa0bec89ec215fd449bd1:/client/graph.c diff --git a/client/graph.c b/client/graph.c index 541e68f3..98dc8043 100644 --- a/client/graph.c +++ b/client/graph.c @@ -9,6 +9,7 @@ //----------------------------------------------------------------------------- #include +#include #include #include "ui.h" #include "graph.h" @@ -35,8 +36,10 @@ void AppendGraph(int redraw, int clock, int bit) int ClearGraph(int redraw) { int gtl = GraphTraceLen; - GraphTraceLen = 0; + memset(GraphBuffer, 0x00, GraphTraceLen); + GraphTraceLen = 0; + if (redraw) RepaintGraphWindow(); @@ -93,3 +96,15 @@ int GetClock(const char *str, int peak, int verbose) return clock; } + + +/* A simple test to see if there is any data inside Graphbuffer. +*/ +bool HasGraphData(){ + + if ( GraphTraceLen <= 0) { + PrintAndLog("No data available, try reading something first"); + return false; + } + return true; +} \ No newline at end of file