AP_Arming: call fettec prearm checks

This commit is contained in:
Peter Barker 2021-07-04 10:47:46 +10:00 committed by Peter Barker
parent 3bc4cf710f
commit 2cf22112a2
2 changed files with 22 additions and 0 deletions

View File

@ -42,6 +42,7 @@
#include <AP_Parachute/AP_Parachute.h>
#include <AP_OSD/AP_OSD.h>
#include <AP_Button/AP_Button.h>
#include <AP_FETtecOneWire/AP_FETtecOneWire.h>
#if HAL_MAX_CAN_PROTOCOL_DRIVERS
#include <AP_CANManager/AP_CANManager.h>
@ -1041,6 +1042,24 @@ bool AP_Arming::osd_checks(bool display_failure) const
return true;
}
bool AP_Arming::fettec_checks(bool display_failure) const
{
#if HAL_AP_FETTEC_ONEWIRE_ENABLED
const AP_FETtecOneWire *f = AP_FETtecOneWire::get_singleton();
if (f == nullptr) {
return true;
}
// check camera is ready
char fail_msg[MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN+1];
if (!f->pre_arm_check(fail_msg, ARRAY_SIZE(fail_msg))) {
check_failed(ARMING_CHECK_ALL, display_failure, "FETtec: %s", fail_msg);
return false;
}
#endif
return true;
}
// request an auxiliary authorisation id. This id should be used in subsequent calls to set_aux_auth_passed/failed
// returns true on success
bool AP_Arming::get_aux_auth_id(uint8_t& auth_id)
@ -1202,6 +1221,7 @@ bool AP_Arming::pre_arm_checks(bool report)
& proximity_checks(report)
& camera_checks(report)
& osd_checks(report)
& fettec_checks(report)
& visodom_checks(report)
& aux_auth_checks(report)
& disarm_switch_checks(report)

View File

@ -180,6 +180,8 @@ protected:
bool can_checks(bool report);
bool fettec_checks(bool display_failure) const;
virtual bool proximity_checks(bool report) const;
bool servo_checks(bool report) const;