141,19 → 141,8 |
Status_t Status; // invalid/newdata/processed |
} __attribute__((packed)) ubx_nav_posllh_t; |
|
typedef struct |
{ |
u32 ITOW; // ms GPS Millisecond Time of Week |
s32 EAST; // cm easting |
s32 NORTH; // cm northing |
s32 ALT; // cm altitude |
s8 ZONE; // UTM zone number |
s8 HEM; // hemissphere indicator (0= North, 1 = South) |
Status_t Status; // invalid/newdata/processed |
} __attribute__((packed)) ubx_nav_posutm_t; |
|
|
|
//------------------------------------------------------------------------------------ |
// global variables |
|
161,7 → 150,7 |
ubx_nav_sol_t UbxSol = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, INVALID}; |
ubx_nav_posllh_t UbxPosLlh = {0,0,0,0,0,0,0, INVALID}; |
ubx_nav_velned_t UbxVelNed = {0,0,0,0,0,0,0,0,0, INVALID}; |
ubx_nav_posutm_t UbxPosUtm = {0,0,0,0,0,0, INVALID}; |
|
// shared buffer |
gps_data_t GPS_Data = {0,0,0,0,0,0,0,0,0,0, INVALID}; |
|
287,7 → 276,6 |
// mark msg buffers invalid |
UbxSol.Status = INVALID; |
UbxPosLlh.Status = INVALID; |
UbxPosUtm.Status = INVALID; |
UbxVelNed.Status = INVALID; |
GPS_Data.Status = INVALID; |
|
313,7 → 301,7 |
// update GPS data only if the taus is INVALID or PROCESSED |
if(GPS_Data.Status != NEWDATA) |
{ // wait for new data at all neccesary ubx messages |
if ((UbxSol.Status == NEWDATA) && (UbxPosLlh.Status == NEWDATA) && (UbxVelNed.Status == NEWDATA) && (UbxPosUtm.Status == NEWDATA)) |
if ((UbxSol.Status == NEWDATA) && (UbxPosLlh.Status == NEWDATA) && (UbxVelNed.Status == NEWDATA)) |
{ |
// NAV SOL |
GPS_Data.Flags = UbxSol.Flags; |
336,9 → 324,6 |
GPS_Data.Speed_Ground = UbxVelNed.GSpeed; |
UbxVelNed.Status = PROCESSED; // ready for new data |
|
// NAV POSUTM (unused) |
UbxPosUtm.Status = PROCESSED; // ready for new data |
|
GPS_Data.Status = NEWDATA; // new data available |
} |
} |
392,12 → 377,6 |
ubxSp = (u8 *)&UbxPosLlh.Status; // status pointer |
break; |
|
case UBX_ID_POSUTM: // geodetic position |
ubxP = (u8 *)&UbxPosUtm; // data start pointer |
ubxEp = (u8 *)(&UbxPosUtm + 1); // data end pointer |
ubxSp = (u8 *)&UbxPosUtm.Status; // status pointer |
break; |
|
case UBX_ID_SOL: // navigation solution |
ubxP = (u8 *)&UbxSol; // data start pointer |
ubxEp = (u8 *)(&UbxSol + 1); // data end pointer |