Browse Source

AP_Arming: use new enum for home_is_set

mission-4.1.18
Andrew Tridgell 10 years ago
parent
commit
3a51bac0d0
  1. 4
      libraries/AP_Arming/AP_Arming.cpp
  2. 4
      libraries/AP_Arming/AP_Arming.h

4
libraries/AP_Arming/AP_Arming.cpp

@ -47,7 +47,7 @@ const AP_Param::GroupInfo AP_Arming::var_info[] PROGMEM = {
//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, const AP_Baro &baro, Compass &compass,
const bool &home_set, gcs_send_t_p gcs_print_func) const enum HomeState &home_set, gcs_send_t_p gcs_print_func)
: armed(false) : armed(false)
, logging_available(false) , logging_available(false)
, skip_gyro_cal(false) , skip_gyro_cal(false)
@ -259,7 +259,7 @@ bool AP_Arming::gps_checks(bool report)
const AP_GPS &gps = ahrs.get_gps(); const AP_GPS &gps = ahrs.get_gps();
//GPS OK? //GPS OK?
if (!home_is_set || if (home_is_set == HOME_UNSET ||
gps.status() < AP_GPS::GPS_OK_FIX_3D || gps.status() < AP_GPS::GPS_OK_FIX_3D ||
AP_Notify::flags.gps_glitching || AP_Notify::flags.gps_glitching ||
AP_Notify::flags.failsafe_gps) { AP_Notify::flags.failsafe_gps) {

4
libraries/AP_Arming/AP_Arming.h

@ -41,7 +41,7 @@ public:
typedef void (*gcs_send_t_p)(gcs_severity, const prog_char_t*); typedef void (*gcs_send_t_p)(gcs_severity, const prog_char_t*);
AP_Arming(const AP_AHRS &ahrs_ref, const AP_Baro &baro, Compass &compass, AP_Arming(const AP_AHRS &ahrs_ref, const AP_Baro &baro, Compass &compass,
const bool &home_set, gcs_send_t_p); const enum HomeState &home_set, gcs_send_t_p);
ArmingRequired arming_required(); ArmingRequired arming_required();
bool arm(uint8_t method); bool arm(uint8_t method);
@ -75,7 +75,7 @@ private:
const AP_AHRS &ahrs; const AP_AHRS &ahrs;
const AP_Baro &barometer; const AP_Baro &barometer;
Compass &_compass; Compass &_compass;
const bool &home_is_set; const enum HomeState &home_is_set;
gcs_send_t_p gcs_send_text_P; gcs_send_t_p gcs_send_text_P;
void set_enabled_checks(uint16_t); void set_enabled_checks(uint16_t);

Loading…
Cancel
Save