AP_Arming: run prearm checks on all vehicles @1Hz, displaying @0.0333Hz
This commit is contained in:
parent
e7b0aff8ec
commit
53e8ab6af8
@ -77,6 +77,10 @@
|
||||
#define ARMING_RUDDER_DEFAULT (uint8_t)RudderArming::ARMDISARM
|
||||
#endif
|
||||
|
||||
#ifndef PREARM_DISPLAY_PERIOD
|
||||
# define PREARM_DISPLAY_PERIOD 30
|
||||
#endif
|
||||
|
||||
extern const AP_HAL::HAL& hal;
|
||||
|
||||
const AP_Param::GroupInfo AP_Arming::var_info[] = {
|
||||
@ -155,6 +159,22 @@ AP_Arming::AP_Arming()
|
||||
AP_Param::setup_object_defaults(this, var_info);
|
||||
}
|
||||
|
||||
// performs pre-arm checks. expects to be called at 1hz.
|
||||
void AP_Arming::update(void)
|
||||
{
|
||||
// perform pre-arm checks & display failures every 30 seconds
|
||||
static uint8_t pre_arm_display_counter = PREARM_DISPLAY_PERIOD/2;
|
||||
pre_arm_display_counter++;
|
||||
bool display_fail = false;
|
||||
if ((_arming_options & uint32_t(AP_Arming::ArmingOptions::DISABLE_PREARM_DISPLAY)) == 0 &&
|
||||
pre_arm_display_counter >= PREARM_DISPLAY_PERIOD) {
|
||||
display_fail = true;
|
||||
pre_arm_display_counter = 0;
|
||||
}
|
||||
|
||||
pre_arm_checks(display_fail);
|
||||
}
|
||||
|
||||
uint16_t AP_Arming::compass_magfield_expected() const
|
||||
{
|
||||
return AP_ARMING_COMPASS_MAGFIELD_EXPECTED;
|
||||
|
@ -14,6 +14,8 @@ public:
|
||||
|
||||
static AP_Arming *get_singleton();
|
||||
|
||||
void update();
|
||||
|
||||
enum ArmingChecks {
|
||||
ARMING_CHECK_ALL = (1U << 0),
|
||||
ARMING_CHECK_BARO = (1U << 1),
|
||||
|
Loading…
Reference in New Issue
Block a user