From 5f6767889a4d59a36d2e5bbd6cc394ce4d266871 Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Fri, 29 Nov 2024 21:49:12 +0000 Subject: [PATCH] AP_Logger: littlefs doesn't have much space free. --- libraries/AP_Logger/AP_Logger.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libraries/AP_Logger/AP_Logger.cpp b/libraries/AP_Logger/AP_Logger.cpp index 60d4e4a1b2dd04..3d834946edf5cc 100644 --- a/libraries/AP_Logger/AP_Logger.cpp +++ b/libraries/AP_Logger/AP_Logger.cpp @@ -56,6 +56,14 @@ extern const AP_HAL::HAL& hal; #define HAL_LOGGER_ARM_PERSIST 15 #endif +#ifndef HAL_LOGGER_MIN_MB_FREE +#if AP_FILESYSTEM_LITTLEFS_ENABLED +#define HAL_LOGGER_MIN_MB_FREE 1 +#else +#define HAL_LOGGER_MIN_MB_FREE 500 +#endif +#endif + #ifndef HAL_LOGGING_BACKENDS_DEFAULT # if HAL_LOGGING_FILESYSTEM_ENABLED && (CONFIG_HAL_BOARD == HAL_BOARD_SITL) # define HAL_LOGGING_BACKENDS_DEFAULT Backend_Type::FILESYSTEM @@ -137,7 +145,7 @@ const AP_Param::GroupInfo AP_Logger::var_info[] = { // @Units: MB // @Range: 10 1000 // @User: Standard - AP_GROUPINFO("_FILE_MB_FREE", 7, AP_Logger, _params.min_MB_free, 500), + AP_GROUPINFO("_FILE_MB_FREE", 7, AP_Logger, _params.min_MB_free, HAL_LOGGER_MIN_MB_FREE), // @Param: _FILE_RATEMAX // @DisplayName: Maximum logging rate for file backend