GPS/GNSS UBX library for UART
Dependencies: Vector3
Diff: GPSUBX_UART.hpp
- Revision:
- 2:6218fe8e54f4
- Parent:
- 1:71f5168e48c8
- Child:
- 3:6c8715574bb8
diff -r 71f5168e48c8 -r 6218fe8e54f4 GPSUBX_UART.hpp --- a/GPSUBX_UART.hpp Fri Sep 17 15:06:47 2021 +0000 +++ b/GPSUBX_UART.hpp Fri Sep 17 15:45:25 2021 +0000 @@ -107,33 +107,36 @@ class GPSUBX_UART { private: + RawSerial serial; char receive_buffer[RECEIVE_SIZE]; char sentence_buffer[SENTENCE_SIZE]; static const float Radius = 6378136.6f; + volatile int receive_index; void Receive(); void Decode(char buffer[], int mc, int mi); public: - int Year; - int Month; - int Day; - int Hours; - int Minutes; - int Seconds; - float Latitude; - float Longitude; - float Height; - int iTOW_POSLLH; - Vector3 VelocityNED; - float Speed; - float GroundSpeed; - float Heading; - int iTOW_VELNED; + + int dummy; // Compiler bug? If "dummy" does not exist, the value of "Year" (under "public:") may include bugs. + volatile int Year; + volatile int Month; + volatile int Day; + volatile int Hours; + volatile int Minutes; + volatile int Seconds; + volatile float Latitude; + volatile float Longitude; + volatile float Height; + volatile int iTOW_POSLLH; + volatile Vector3 VelocityNED; + volatile float Speed; + volatile float GroundSpeed; + volatile float Heading; + volatile int iTOW_VELNED; - int TimeZone; - volatile int receive_index; + volatile int TimeZone; Vector3 UniversalZeroPosition; Vector3 UniversalZeroUnitN; @@ -146,7 +149,6 @@ void Update(); void Attach(); - // Position Calculation Vector3 ToUniversalUnit(); Vector3 ToUniversal(); void CalculateUnit();