AP_HAL_ChibiOS: allow AP_TERRAIN_ENABLED to be turned off in hwdef

adds the ifndef, and changes things to the path defines are undefined if it is false
This commit is contained in:
Peter Barker 2024-02-23 20:03:08 +11:00 committed by Andrew Tridgell
parent 5cc48a12e2
commit 2e2b1c9fac
1 changed files with 12 additions and 3 deletions

View File

@ -10,9 +10,18 @@
#define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS" #define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
#endif #endif
// a similar define is present in AP_HAL_Boards.h:
#ifndef HAL_OS_FATFS_IO
#define HAL_OS_FATFS_IO 0
#endif
#ifndef AP_TERRAIN_AVAILABLE
// enable terrain only if there's an SD card available:
#define AP_TERRAIN_AVAILABLE HAL_OS_FATFS_IO
#endif
#if AP_TERRAIN_AVAILABLE
#ifndef HAL_BOARD_TERRAIN_DIRECTORY #ifndef HAL_BOARD_TERRAIN_DIRECTORY
#define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN" #define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
#endif #endif
#endif // AP_TERRAIN_AVAILABLE
// enable terrain only if there's an SD card available:
#define AP_TERRAIN_AVAILABLE HAL_OS_FATFS_IO