From 84021495725b63a819f1a4d3a5773ede05b45531 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 10 May 2022 17:53:32 +1000 Subject: [PATCH] AP_Vehicle: run prearm checks on all vehicles @1Hz, displaying @0.0333Hz --- libraries/AP_Vehicle/AP_Vehicle.cpp | 7 +++++++ libraries/AP_Vehicle/AP_Vehicle.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/libraries/AP_Vehicle/AP_Vehicle.cpp b/libraries/AP_Vehicle/AP_Vehicle.cpp index 324763a4b3..284b477c98 100644 --- a/libraries/AP_Vehicle/AP_Vehicle.cpp +++ b/libraries/AP_Vehicle/AP_Vehicle.cpp @@ -304,6 +304,7 @@ const AP_Scheduler::Task AP_Vehicle::scheduler_tasks[] = { #if HAL_EFI_ENABLED SCHED_TASK_CLASS(AP_EFI, &vehicle.efi, update, 10, 200, 250), #endif + SCHED_TASK(update_arming, 1, 50, 253), }; void AP_Vehicle::get_common_scheduler_tasks(const AP_Scheduler::Task*& tasks, uint8_t& num_tasks) @@ -592,6 +593,12 @@ void AP_Vehicle::accel_cal_update() } #endif // HAL_INS_ACCELCAL_ENABLED +// call the arming library's update function +void AP_Vehicle::update_arming() +{ + AP::arming().update(); +} + AP_Vehicle *AP_Vehicle::_singleton = nullptr; AP_Vehicle *AP_Vehicle::get_singleton() diff --git a/libraries/AP_Vehicle/AP_Vehicle.h b/libraries/AP_Vehicle/AP_Vehicle.h index 3102f79535..e5e144c327 100644 --- a/libraries/AP_Vehicle/AP_Vehicle.h +++ b/libraries/AP_Vehicle/AP_Vehicle.h @@ -393,6 +393,9 @@ protected: void accel_cal_update(); #endif + // call the arming library's update function + void update_arming(); + ModeReason control_mode_reason = ModeReason::UNKNOWN; #if AP_SIM_ENABLED