Subversion Repositories NaviCtrl

Rev

Rev 263 | Rev 270 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 263 Rev 264
Line 277... Line 277...
277
/********************************************************/
277
/********************************************************/
278
/*            Upate GPS data stcructure                 */
278
/*            Upate GPS data stcructure                 */
279
/********************************************************/
279
/********************************************************/
280
void Update_GPSData(void)
280
void Update_GPSData(void)
281
{
281
{
282
        static u32 LastTimeStamp = 0;
-
 
283
        u32 TimeStamp;
-
 
284
        static u32 last_itow = 0;
282
        static u32 last_itow = 0;
Line 285... Line 283...
285
 
283
 
286
        // if a new set of ubx messages was collected
284
        // if a new set of ubx messages was collected
287
        if((UbxSol.Status == NEWDATA) && (UbxPosLlh.Status == NEWDATA) && (UbxVelNed.Status == NEWDATA))
285
        if((UbxSol.Status == NEWDATA) && (UbxPosLlh.Status == NEWDATA) && (UbxVelNed.Status == NEWDATA))
288
        {       // and the itow is equal (same time base)
286
        {       // and the itow is equal (same time base)
289
                if((UbxSol.itow == UbxPosLlh.itow) && (UbxPosLlh.itow == UbxVelNed.itow))
287
                if((UbxSol.itow == UbxPosLlh.itow) && (UbxPosLlh.itow == UbxVelNed.itow))
290
                {
-
 
291
                        DebugOut.Analog[23] = (u16)(UbxSol.itow-last_itow);
-
 
292
                        last_itow = UbxSol.itow; // update last itow
288
                {
293
                        UBX_Timeout = SetDelay(UBX_TIMEOUT);
289
                        UBX_Timeout = SetDelay(UBX_TIMEOUT);
294
                        DebugOut.Analog[9]++;
290
                        DebugOut.Analog[9]++;
295
                        // update GPS data only if the status is INVALID or PROCESSED
291
                        // update GPS data only if the status is INVALID or PROCESSED
296
                        if(GPSData.Status != NEWDATA)  
292
                        if(GPSData.Status != NEWDATA)  
297
                        { // wait for new data at all neccesary ubx messages
293
                        { // wait for new data at all neccesary ubx messages
298
                                GPSData.Status = INVALID;
294
                                GPSData.Status = INVALID;
299
                                // update message cycle time
-
 
300
                                TimeStamp = CountMilliseconds;
295
                                // update message cycle time
301
                                GPSData.MsgCycleTime = (u16)(TimeStamp - LastTimeStamp);
296
                                GPSData.MsgCycleTime = (u16)(UbxSol.itow-last_itow);
302
                                LastTimeStamp = TimeStamp;
297
                                last_itow = UbxSol.itow; // update last itow
303
                                DebugOut.Analog[16] = GPSData.MsgCycleTime;
298
                                DebugOut.Analog[16] = GPSData.MsgCycleTime;
304
                                // NAV SOL
299
                                // NAV SOL
305
                                GPSData.Flags =                                 UbxSol.Flags;
300
                                GPSData.Flags =                                 UbxSol.Flags;
306
                                GPSData.NumOfSats =                     UbxSol.numSV;
301
                                GPSData.NumOfSats =                     UbxSol.numSV;