AP_Vehicle: move EFI to AP_Vehicle

This commit is contained in:
Peter Barker 2021-10-21 17:37:35 +11:00 committed by Peter Barker
parent 56dda4c07f
commit ce352410e1
2 changed files with 21 additions and 0 deletions

View File

@ -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)

View File

@ -25,6 +25,7 @@
#include <AP_BoardConfig/AP_BoardConfig.h> // board configuration library
#include <AP_CANManager/AP_CANManager.h>
#include <AP_Button/AP_Button.h>
#include <AP_EFI/AP_EFI.h>
#include <AP_GPS/AP_GPS.h>
#include <AP_Generator/AP_Generator.h>
#include <AP_Logger/AP_Logger.h>
@ -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[];