X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/7fe9b0b742d7dae9c5af1d292d11840b5c3cbfae..7c756d68925891ec3d3aa0bec89ec215fd449bd1:/client/graph.c diff --git a/client/graph.c b/client/graph.c index 4a966676..98dc8043 100644 --- a/client/graph.c +++ b/client/graph.c @@ -1,4 +1,15 @@ +//----------------------------------------------------------------------------- +// Copyright (C) 2010 iZsh +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// Graph utilities +//----------------------------------------------------------------------------- + #include +#include #include #include "ui.h" #include "graph.h" @@ -25,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(); @@ -83,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