From 0f4262de3d6cfec5443653be466b01f5885c4d9f Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 12 Dec 2023 23:10:17 +1100 Subject: [PATCH] AP_Scheduler: correct compilation when AP_Vehicle not available --- libraries/AP_Scheduler/AP_Scheduler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/AP_Scheduler/AP_Scheduler.cpp b/libraries/AP_Scheduler/AP_Scheduler.cpp index abfbf2fec5..93f55a2277 100644 --- a/libraries/AP_Scheduler/AP_Scheduler.cpp +++ b/libraries/AP_Scheduler/AP_Scheduler.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #if CONFIG_HAL_BOARD == HAL_BOARD_SITL #include @@ -113,10 +114,12 @@ void AP_Scheduler::init(const AP_Scheduler::Task *tasks, uint8_t num_tasks, uint _vehicle_tasks = tasks; _num_vehicle_tasks = num_tasks; +#if AP_VEHICLE_ENABLED AP_Vehicle* vehicle = AP::vehicle(); if (vehicle != nullptr) { vehicle->get_common_scheduler_tasks(_common_tasks, _num_common_tasks); } +#endif _num_tasks = _num_vehicle_tasks + _num_common_tasks;