From 3411b85b7155132348fd32e7e42c273021d1b480 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 3 Nov 2023 12:06:20 +1100 Subject: [PATCH] AP_TempCalibration: add and use AP_TEMPCALIBRATION_ENABLED --- libraries/AP_TempCalibration/AP_TempCalibration.cpp | 6 ++++++ libraries/AP_TempCalibration/AP_TempCalibration.h | 6 ++++++ libraries/AP_TempCalibration/AP_TempCalibration_config.h | 7 +++++++ 3 files changed, 19 insertions(+) create mode 100644 libraries/AP_TempCalibration/AP_TempCalibration_config.h diff --git a/libraries/AP_TempCalibration/AP_TempCalibration.cpp b/libraries/AP_TempCalibration/AP_TempCalibration.cpp index 529c9a90b6..574dc9258d 100644 --- a/libraries/AP_TempCalibration/AP_TempCalibration.cpp +++ b/libraries/AP_TempCalibration/AP_TempCalibration.cpp @@ -16,6 +16,10 @@ temperature calibration library */ +#include "AP_TempCalibration_config.h" + +#if AP_TEMPCALIBRATION_ENABLED + #include "AP_TempCalibration.h" #include #include @@ -231,3 +235,5 @@ void AP_TempCalibration::update(void) break; } } + +#endif // AP_TEMPCALIBRATION_ENABLED diff --git a/libraries/AP_TempCalibration/AP_TempCalibration.h b/libraries/AP_TempCalibration/AP_TempCalibration.h index 5572258586..0b8eecc68f 100644 --- a/libraries/AP_TempCalibration/AP_TempCalibration.h +++ b/libraries/AP_TempCalibration/AP_TempCalibration.h @@ -18,6 +18,10 @@ and opportunistically calibrates sensors when the vehicle is still */ +#include "AP_TempCalibration_config.h" + +#if AP_TEMPCALIBRATION_ENABLED + #include #include #include @@ -79,3 +83,5 @@ private: float calculate_p_range(float baro_factor) const; }; + +#endif // AP_TEMPCALIBRATION_ENABLED diff --git a/libraries/AP_TempCalibration/AP_TempCalibration_config.h b/libraries/AP_TempCalibration/AP_TempCalibration_config.h new file mode 100644 index 0000000000..9a936924c4 --- /dev/null +++ b/libraries/AP_TempCalibration/AP_TempCalibration_config.h @@ -0,0 +1,7 @@ +#pragma once + +#include + +#ifndef AP_TEMPCALIBRATION_ENABLED +#define AP_TEMPCALIBRATION_ENABLED 1 +#endif