diff --git a/libraries/AP_HAL_Linux/AnalogIn.cpp b/libraries/AP_HAL_Linux/AnalogIn.cpp index ff9fdcdc28..f919b62c14 100644 --- a/libraries/AP_HAL_Linux/AnalogIn.cpp +++ b/libraries/AP_HAL_Linux/AnalogIn.cpp @@ -1,3 +1,6 @@ +#include + +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX #include "AnalogIn.h" using namespace Linux; @@ -41,4 +44,4 @@ AP_HAL::AnalogSource* LinuxAnalogIn::channel(int16_t n) { return new LinuxAnalogSource(1.11); } - +#endif // CONFIG_HAL_BOARD diff --git a/libraries/AP_HAL_Linux/GPIO.cpp b/libraries/AP_HAL_Linux/GPIO.cpp index 5025c31c7c..57f8d95ae8 100644 --- a/libraries/AP_HAL_Linux/GPIO.cpp +++ b/libraries/AP_HAL_Linux/GPIO.cpp @@ -1,3 +1,6 @@ +#include + +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX #include "GPIO.h" @@ -62,3 +65,5 @@ void LinuxDigitalSource::write(uint8_t value) { void LinuxDigitalSource::toggle() { _v = !_v; } + +#endif // CONFIG_HAL_BOARD diff --git a/libraries/AP_HAL_Linux/RCInput.cpp b/libraries/AP_HAL_Linux/RCInput.cpp index 3603a27d59..5fed044e30 100644 --- a/libraries/AP_HAL_Linux/RCInput.cpp +++ b/libraries/AP_HAL_Linux/RCInput.cpp @@ -1,3 +1,6 @@ +#include + +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX #include "RCInput.h" @@ -36,3 +39,4 @@ bool LinuxRCInput::set_override(uint8_t channel, int16_t override) { void LinuxRCInput::clear_overrides() {} +#endif // CONFIG_HAL_BOARD diff --git a/libraries/AP_HAL_Linux/RCOutput.cpp b/libraries/AP_HAL_Linux/RCOutput.cpp index 0bda3d17e9..80fff7b099 100644 --- a/libraries/AP_HAL_Linux/RCOutput.cpp +++ b/libraries/AP_HAL_Linux/RCOutput.cpp @@ -1,3 +1,6 @@ +#include + +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX #include "RCOutput.h" @@ -36,3 +39,4 @@ uint16_t LinuxRCOutput::read(uint8_t ch) { void LinuxRCOutput::read(uint16_t* period_us, uint8_t len) {} +#endif // CONFIG_HAL_BOARD