+// option '1' to save GraphBuffer any other to restore
+void save_restoreGB(uint8_t saveOpt)
+{
+ static int SavedGB[MAX_GRAPH_TRACE_LEN];
+ static int SavedGBlen=0;
+ static bool GB_Saved = false;
+ static int SavedGridOffsetAdj=0;
+
+ 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;
+}