Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2057 → Rev 2058

/branches/dongfang_FC_rewrite/ubx.c
1,7 → 1,7
#include <inttypes.h>
#include "ubx.h"
//#include "main.h"
#include <avr/io.h>
#include "output.h"
 
// ubx protocol parser state machine
#define UBXSTATE_IDLE 0
75,13 → 75,16
GPS_INFO_t GPSInfo = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, INVALID };
 
volatile uint8_t GPSTimeout = 0;
volatile uint16_t GPSDatasetCounter = 0;
 
void updateGPSInfo(void) {
if ((ubxSol.status == NEWDATA) && (ubxPosLlh.status == NEWDATA)
&& (ubxVelNed.status == NEWDATA)) {
if ((ubxSol.status == NEWDATA) && (ubxPosLlh.status == NEWDATA) && (ubxVelNed.status == NEWDATA)) {
//RED_FLASH;
// DebugOut.Digital ....blah...
if (GPSInfo.status != NEWDATA) {
GPSDatasetCounter++;
debugOut.analog[31] = GPSDatasetCounter;
 
GPSInfo.status = INVALID;
// NAV SOL
GPSInfo.flags = ubxSol.flags;
185,8 → 188,7
if (*ubxSp == NEWDATA) {
updateGPSInfo(); //update GPS info respectively
ubxstate = UBXSTATE_IDLE;
} else // data invalid or allready processd
{
} else {// data invalid or already processd
*ubxSp = INVALID;
ubxstate = UBXSTATE_DATA;
}