GPS: added set_secondary() function

for preventing notify updates for 2nd GPS
This commit is contained in:
Andrew Tridgell 2014-03-08 21:47:49 +11:00
parent 148fd889bc
commit 794cc33e6a
2 changed files with 10 additions and 2 deletions

View File

@ -36,6 +36,7 @@ GPS::GPS(void) :
last_fix_time(0),
_have_raw_velocity(false),
_last_gps_time(0),
_secondary_gps(false),
_idleTimer(0),
_status(GPS::NO_FIX),
_last_ground_speed_cm(0),
@ -108,9 +109,11 @@ GPS::update(void)
}
}
if (!_secondary_gps) {
// update notify with gps status
AP_Notify::flags.gps_status = _status;
}
}
void
GPS::setHIL(Fix_Status fix_status,

View File

@ -146,6 +146,8 @@ public:
// return true if the GPS supports vertical velocity values
bool have_vertical_velocity(void) const { return _have_raw_velocity; }
void set_secondary(void) { _secondary_gps = true; }
protected:
AP_HAL::UARTDriver *_port; ///< port the GPS is attached to
@ -204,6 +206,9 @@ protected:
// the time we got the last GPS timestamp
uint32_t _last_gps_time;
// this is a secondary GPS, disable notify updates
bool _secondary_gps;
// return time in seconds since GPS epoch given time components
void _make_gps_time(uint32_t bcd_date, uint32_t bcd_milliseconds);