AP_Compass: exclude cpp files if not AP_COMPASS_ENABLED

This commit is contained in:
Peter Barker 2024-02-23 19:29:09 +11:00 committed by Andrew Tridgell
parent 89d8a1351c
commit c36b57acba
2 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,7 @@
#include "AP_Compass_config.h"
#if AP_COMPASS_ENABLED
#include <AP_HAL/AP_HAL.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX
#include <AP_HAL_Linux/I2CDevice.h>
@ -2236,3 +2240,5 @@ Compass &compass()
}
}
#endif // AP_COMPASS_ENABLED

View File

@ -1,3 +1,7 @@
#include "AP_Compass_config.h"
#if AP_COMPASS_ENABLED
#include <AP_HAL/AP_HAL.h>
#include "AP_Compass.h"
@ -294,3 +298,5 @@ enum Rotation AP_Compass_Backend::get_board_orientation(void) const
{
return _compass._board_orientation;
}
#endif // AP_COMPASS_ENABLED