+//-----------------------------------------------------------------------------
+// Copyright (C) 2010 iZsh <izsh at fail0verflow.com>
+//
+// 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 <stdio.h>
+#include <stdbool.h>
#include <string.h>
#include "ui.h"
#include "graph.h"
int ClearGraph(int redraw)
{
int gtl = GraphTraceLen;
- GraphTraceLen = 0;
+ memset(GraphBuffer, 0x00, GraphTraceLen);
+ GraphTraceLen = 0;
+
if (redraw)
RepaintGraphWindow();
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