From 1abe46e9239967209d716cce21c74269695c0338 Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Wed, 11 Dec 2024 20:10:03 +0000 Subject: [PATCH] AP_HAL_ChibiOS: terrain turned on on 2Mb boards with littlefs --- libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py | 1 - libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_normal.h | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index e9f227d635..c4cdc3df85 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -989,7 +989,6 @@ class ChibiOSHWDef(object): f.write('#define HAL_USE_SDC FALSE\n') self.build_flags.append('USE_FATFS=no') self.env_vars['WITH_LITTLEFS'] = "1" - self.env_vars['DISABLE_SCRIPTING'] = True else: f.write('#define HAL_USE_SDC FALSE\n') self.build_flags.append('USE_FATFS=no') diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_normal.h b/libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_normal.h index 82d108d902..373c30497e 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_normal.h +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_normal.h @@ -11,13 +11,18 @@ #endif // a similar define is present in AP_HAL_Boards.h: +// needed to compile chibios #ifndef HAL_OS_FATFS_IO #define HAL_OS_FATFS_IO 0 #endif +#ifndef HAL_OS_LITTLEFS_IO +#define HAL_OS_LITTLEFS_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 +#define AP_TERRAIN_AVAILABLE (HAL_OS_FATFS_IO || (HAL_OS_LITTLEFS_IO && (BOARD_FLASH_SIZE>1024))) #endif #if AP_TERRAIN_AVAILABLE