AP_AdvancedFailsafe: use baro singleton

This commit is contained in:
Peter Barker 2018-03-06 07:34:43 +11:00 committed by Lucas De Marchi
parent 024b29858d
commit 747dbea476
2 changed files with 2 additions and 3 deletions

View File

@ -325,6 +325,7 @@ AP_AdvancedFailsafe::check_altlimit(void)
}
// see if the barometer is dead
const AP_Baro &baro = AP::baro();
if (AP_HAL::millis() - baro.get_last_update() > 5000) {
// the barometer has been unresponsive for 5 seconds. See if we can switch to GPS
if (_amsl_margin_gps != -1 &&

View File

@ -51,9 +51,8 @@ public:
};
// Constructor
AP_AdvancedFailsafe(AP_Mission &_mission, AP_Baro &_baro, const AP_GPS &_gps, const RCMapper &_rcmap) :
AP_AdvancedFailsafe(AP_Mission &_mission, const AP_GPS &_gps, const RCMapper &_rcmap) :
mission(_mission),
baro(_baro),
gps(_gps),
rcmap(_rcmap),
_gps_loss_count(0),
@ -96,7 +95,6 @@ protected:
enum state _state;
AP_Mission &mission;
AP_Baro &baro;
const AP_GPS &gps;
const RCMapper &rcmap;