I messed up the merge, so pushing it over to another repo so I don't lose it. Will tidy up and remove later

Dependencies:   BufferedSerial FatFileSystemCpp mbed

Revision:
16:a8d3a0dbe4bf
Parent:
14:76083dc18b0d
Child:
18:ad407a2ed4c9
--- a/VIPSSerialProtocol.h	Mon Mar 08 17:29:31 2021 +0000
+++ b/VIPSSerialProtocol.h	Fri Apr 30 11:26:34 2021 +0000
@@ -25,6 +25,14 @@
 
 //  void setOutMask(uint32_t outputMask) {_outputMask = outputMask;};
 
+    bool EnableSmoothing(bool enabled) { hyperSmoothEnabled = enabled; return hyperSmoothEnabled;};
+    bool SmoothingEnabled(void) { return hyperSmoothEnabled;};
+
+    int GetSmoothLevel(void) { return SmoothBy; };
+    bool SetSmoothLevel (const int newSmooth) { if (newSmooth == SmoothBy) return false; SmoothBy = newSmooth; SmoothRunning = false; return true; };
+    void EnableBypass(bool enable) { BypassMode = enable;};
+    void bypassTx(char byte);
+
 private:
 
     struct posAndTime_s {
@@ -32,6 +40,7 @@
         position pos;
     };
 
+    void smoothOutputPacket(position *posPtr);
     void onSerialRx(void);
     void processRxMessage();
     bool checkCRC(unsigned char* data);
@@ -59,9 +68,19 @@
     int statusMessage;
     bool enableAllUpdates;
     bool newFormatMsg;
+    bool hyperSmoothEnabled;
     uint32_t pointCount;
     uint32_t _outputMask;
 
+    int SmoothBy;
+    // total as a float we would start to see rounding errors at valuses of ~20m 
+    double XSmoothTotal;
+    double YSmoothTotal;
+    double ZSmoothTotal;
+    bool SmoothRunning;
+    bool BypassMode;
+
+
 };
 
 #endif