Skip to content

Commit

Permalink
AP_HAL_ChibiOS: allow AP_TERRAIN_ENABLED to be turned off in hwdef
Browse files Browse the repository at this point in the history
adds the ifndef, and changes things to the path defines are undefined if it is false
  • Loading branch information
peterbarker committed Feb 23, 2024
1 parent c8b5de3 commit 166e737
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_normal.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,18 @@
#define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
#endif

#ifndef HAL_BOARD_TERRAIN_DIRECTORY
#define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
// 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
#endif // AP_TERRAIN_AVAILABLE

0 comments on commit 166e737

Please sign in to comment.