//-----------------------------------------------------------------------------
#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