mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-18 06:38:29 -04:00
AP_Arming: Reduce response time when checks go from true to false
This commit is contained in:
parent
4ffcc56cdb
commit
8f9df5a62e
@ -183,7 +183,9 @@ void AP_Arming::update(void)
|
|||||||
const uint32_t now_ms = AP_HAL::millis();
|
const uint32_t now_ms = AP_HAL::millis();
|
||||||
// perform pre-arm checks & display failures every 30 seconds
|
// perform pre-arm checks & display failures every 30 seconds
|
||||||
bool display_fail = false;
|
bool display_fail = false;
|
||||||
if (now_ms - last_prearm_display_ms > PREARM_DISPLAY_PERIOD*1000) {
|
if ((report_immediately && (now_ms - last_prearm_display_ms > 4000)) ||
|
||||||
|
(now_ms - last_prearm_display_ms > PREARM_DISPLAY_PERIOD*1000)) {
|
||||||
|
report_immediately = false;
|
||||||
display_fail = true;
|
display_fail = true;
|
||||||
last_prearm_display_ms = now_ms;
|
last_prearm_display_ms = now_ms;
|
||||||
}
|
}
|
||||||
@ -1540,7 +1542,7 @@ bool AP_Arming::pre_arm_checks(bool report)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return hardware_safety_check(report)
|
bool checks_result = hardware_safety_check(report)
|
||||||
#if HAL_HAVE_IMU_HEATER
|
#if HAL_HAVE_IMU_HEATER
|
||||||
& heater_min_temperature_checks(report)
|
& heater_min_temperature_checks(report)
|
||||||
#endif
|
#endif
|
||||||
@ -1575,6 +1577,13 @@ bool AP_Arming::pre_arm_checks(bool report)
|
|||||||
& opendroneid_checks(report)
|
& opendroneid_checks(report)
|
||||||
& serial_protocol_checks(report)
|
& serial_protocol_checks(report)
|
||||||
& estop_checks(report);
|
& estop_checks(report);
|
||||||
|
|
||||||
|
if (!checks_result && last_prearm_checks_result) { // check went from true to false
|
||||||
|
report_immediately = true;
|
||||||
|
}
|
||||||
|
last_prearm_checks_result = checks_result;
|
||||||
|
|
||||||
|
return checks_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AP_Arming::arm_checks(AP_Arming::Method method)
|
bool AP_Arming::arm_checks(AP_Arming::Method method)
|
||||||
|
@ -304,6 +304,9 @@ private:
|
|||||||
uint32_t last_prearm_display_ms; // last time we send statustexts for prearm failures
|
uint32_t last_prearm_display_ms; // last time we send statustexts for prearm failures
|
||||||
bool running_arming_checks; // true if the arming checks currently being performed are being done because the vehicle is trying to arm the vehicle
|
bool running_arming_checks; // true if the arming checks currently being performed are being done because the vehicle is trying to arm the vehicle
|
||||||
|
|
||||||
|
bool last_prearm_checks_result; // result of last prearm check
|
||||||
|
bool report_immediately; // set to true when check goes from true to false, to trigger immediate report
|
||||||
|
|
||||||
void update_arm_gpio();
|
void update_arm_gpio();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user