4,7 → 4,6 |
#include <avr/io.h> |
|
#include "uart.h" |
#include "timer0.h" |
|
// ubx protocol parser state machine |
#define UBXSTATE_IDLE 0 |
26,7 → 25,6 |
#define UBX_SYNC1_CHAR 0xB5 |
#define UBX_SYNC2_CHAR 0x62 |
|
|
typedef struct { |
uint32_t ITOW; // ms GPS Millisecond Time of Week |
uint8_t GPSfix; // GPSfix Type, range 0..6 |
106,7 → 104,7 |
GPSInfo.veleast = GpsVelNed.VEL_E; |
GPSInfo.velnorth = GpsVelNed.VEL_N; |
GPSInfo.veltop = -GpsVelNed.VEL_D; |
GpsPosUtm.Status = PROCESSED; // never update old data |
GpsVelNed.Status = PROCESSED; // never update old data |
} |
if (GpsStatus.Status != INVALID) |
{ |
114,6 → 112,15 |
} |
} |
|
void ubx_init(void) |
{ |
GpsStatus.Status = INVALID; |
GpsPosLlh.Status = INVALID; |
GpsPosUtm.Status = INVALID; |
GpsVelNed.Status = INVALID; |
GPSInfo.status = INVALID; |
} |
|
// this function should be called within the UART RX ISR |
void ubx_parser(uint8_t c) |
{ |
236,3 → 243,4 |
|
} |
|
|