From ce352410e1e65be9765c1758a2d8dae0c42b1f7e Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 21 Oct 2021 17:37:35 +1100 Subject: [PATCH] AP_Vehicle: move EFI to AP_Vehicle --- libraries/AP_Vehicle/AP_Vehicle.cpp | 15 +++++++++++++++ libraries/AP_Vehicle/AP_Vehicle.h | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/libraries/AP_Vehicle/AP_Vehicle.cpp b/libraries/AP_Vehicle/AP_Vehicle.cpp index e3b34f628b..e804815022 100644 --- a/libraries/AP_Vehicle/AP_Vehicle.cpp +++ b/libraries/AP_Vehicle/AP_Vehicle.cpp @@ -61,6 +61,12 @@ const AP_Param::GroupInfo AP_Vehicle::var_info[] = { AP_SUBGROUPINFO(externalAHRS, "EAHRS", 8, AP_Vehicle, AP_ExternalAHRS), #endif +#if HAL_EFI_ENABLED + // @Group: EFI + // @Path: ../AP_EFI/AP_EFI.cpp + AP_SUBGROUPINFO(efi, "EFI", 9, AP_Vehicle, AP_EFI), +#endif + AP_GROUPEND }; @@ -174,6 +180,12 @@ void AP_Vehicle::setup() #if HAL_GENERATOR_ENABLED generator.init(); #endif + +// init EFI monitoring +#if HAL_EFI_ENABLED + efi.init(); +#endif + gcs().send_text(MAV_SEVERITY_INFO, "ArduPilot Ready"); } @@ -243,6 +255,9 @@ const AP_Scheduler::Task AP_Vehicle::scheduler_tasks[] = { SCHED_TASK(publish_osd_info, 1, 10), #endif SCHED_TASK(accel_cal_update, 10, 100), +#if HAL_EFI_ENABLED + SCHED_TASK_CLASS(AP_EFI, &vehicle.efi, update, 10, 200), +#endif }; void AP_Vehicle::get_common_scheduler_tasks(const AP_Scheduler::Task*& tasks, uint8_t& num_tasks) diff --git a/libraries/AP_Vehicle/AP_Vehicle.h b/libraries/AP_Vehicle/AP_Vehicle.h index 017a6b5cba..22a3c7a624 100644 --- a/libraries/AP_Vehicle/AP_Vehicle.h +++ b/libraries/AP_Vehicle/AP_Vehicle.h @@ -25,6 +25,7 @@ #include // board configuration library #include #include +#include #include #include #include @@ -354,6 +355,11 @@ protected: AP_SmartAudio smartaudio; #endif +#if HAL_EFI_ENABLED + // EFI Engine Monitor + AP_EFI efi; +#endif + static const struct AP_Param::GroupInfo var_info[]; static const struct AP_Scheduler::Task scheduler_tasks[];