From 2e2b1c9fac502165d9a145197b14c2ad0cc454e8 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 23 Feb 2024 20:03:08 +1100 Subject: [PATCH] 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 --- .../hwdef/scripts/defaults_normal.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_normal.h b/libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_normal.h index 718da256e0..82d108d902 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_normal.h +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_normal.h @@ -10,9 +10,18 @@ #define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS" #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 #define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN" #endif - -// enable terrain only if there's an SD card available: -#define AP_TERRAIN_AVAILABLE HAL_OS_FATFS_IO +#endif // AP_TERRAIN_AVAILABLE