Browse Source

AP_Arming: use baro singleton

master
Peter Barker 7 years ago committed by Lucas De Marchi
parent
commit
8d8f2208c0
  1. 5
      libraries/AP_Arming/AP_Arming.cpp
  2. 3
      libraries/AP_Arming/AP_Arming.h

5
libraries/AP_Arming/AP_Arming.cpp

@ -77,10 +77,9 @@ const AP_Param::GroupInfo AP_Arming::var_info[] = {
//The function point is particularly hacky, hacky, tacky //The function point is particularly hacky, hacky, tacky
//but I don't want to reimplement messaging to GCS at the moment: //but I don't want to reimplement messaging to GCS at the moment:
AP_Arming::AP_Arming(const AP_AHRS &ahrs_ref, const AP_Baro &baro, Compass &compass, AP_Arming::AP_Arming(const AP_AHRS &ahrs_ref, Compass &compass,
const AP_BattMonitor &battery) : const AP_BattMonitor &battery) :
ahrs(ahrs_ref), ahrs(ahrs_ref),
barometer(baro),
_compass(compass), _compass(compass),
_battery(battery), _battery(battery),
armed(false), armed(false),
@ -116,7 +115,7 @@ bool AP_Arming::barometer_checks(bool report)
{ {
if ((checks_to_perform & ARMING_CHECK_ALL) || if ((checks_to_perform & ARMING_CHECK_ALL) ||
(checks_to_perform & ARMING_CHECK_BARO)) { (checks_to_perform & ARMING_CHECK_BARO)) {
if (!barometer.all_healthy()) { if (!AP::baro().all_healthy()) {
if (report) { if (report) {
gcs().send_text(MAV_SEVERITY_CRITICAL, "PreArm: Barometer not healthy"); gcs().send_text(MAV_SEVERITY_CRITICAL, "PreArm: Barometer not healthy");
} }

3
libraries/AP_Arming/AP_Arming.h

@ -61,7 +61,7 @@ public:
static const struct AP_Param::GroupInfo var_info[]; static const struct AP_Param::GroupInfo var_info[];
protected: protected:
AP_Arming(const AP_AHRS &ahrs_ref, const AP_Baro &baro, Compass &compass, AP_Arming(const AP_AHRS &ahrs_ref, Compass &compass,
const AP_BattMonitor &battery); const AP_BattMonitor &battery);
// Parameters // Parameters
@ -72,7 +72,6 @@ protected:
// references // references
const AP_AHRS &ahrs; const AP_AHRS &ahrs;
const AP_Baro &barometer;
Compass &_compass; Compass &_compass;
const AP_BattMonitor &_battery; const AP_BattMonitor &_battery;

Loading…
Cancel
Save