diff --git a/libraries/AP_Scheduler/AP_Scheduler.cpp b/libraries/AP_Scheduler/AP_Scheduler.cpp index 62a702bb86..f879a1f6e7 100644 --- a/libraries/AP_Scheduler/AP_Scheduler.cpp +++ b/libraries/AP_Scheduler/AP_Scheduler.cpp @@ -21,6 +21,8 @@ #include "AP_Scheduler_config.h" +#if AP_SCHEDULER_ENABLED + #include "AP_Scheduler.h" #include @@ -539,3 +541,5 @@ AP_Scheduler &scheduler() } }; + +#endif // AP_SCHEDULER_ENABLED diff --git a/libraries/AP_Scheduler/AP_Scheduler.h b/libraries/AP_Scheduler/AP_Scheduler.h index 68f39de24a..bf15592d49 100644 --- a/libraries/AP_Scheduler/AP_Scheduler.h +++ b/libraries/AP_Scheduler/AP_Scheduler.h @@ -22,6 +22,8 @@ #include "AP_Scheduler_config.h" +#if AP_SCHEDULER_ENABLED + #include #include #include @@ -268,3 +270,5 @@ private: namespace AP { AP_Scheduler &scheduler(); }; + +#endif // AP_SCHEDULER_ENABLED diff --git a/libraries/AP_Scheduler/PerfInfo.cpp b/libraries/AP_Scheduler/PerfInfo.cpp index 1a9db4a96e..6fb2f6dd5d 100644 --- a/libraries/AP_Scheduler/PerfInfo.cpp +++ b/libraries/AP_Scheduler/PerfInfo.cpp @@ -1,3 +1,7 @@ +#include "AP_Scheduler_config.h" + +#if AP_SCHEDULER_ENABLED + #include "PerfInfo.h" #include @@ -217,3 +221,5 @@ void AP::PerfInfo::set_loop_rate(uint16_t rate_hz) filtered_loop_time = 1.0f / rate_hz; } } + +#endif // AP_SCHEDULER_ENABLED diff --git a/libraries/AP_Scheduler/PerfInfo.h b/libraries/AP_Scheduler/PerfInfo.h index 83a8e3bdf9..bbf6052e60 100644 --- a/libraries/AP_Scheduler/PerfInfo.h +++ b/libraries/AP_Scheduler/PerfInfo.h @@ -1,5 +1,9 @@ #pragma once +#include "AP_Scheduler_config.h" + +#if AP_SCHEDULER_ENABLED + #include #include @@ -76,3 +80,5 @@ private: }; }; + +#endif // AP_SCHEDULER_ENABLED