From c95ead61116b5e1d4ecd8f023e1e1d9ba9639df0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 15 Feb 2024 12:23:10 +1100 Subject: [PATCH] AP_Param: fixed build of CubeOrange-periph --- libraries/AP_Param/AP_Param.cpp | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/libraries/AP_Param/AP_Param.cpp b/libraries/AP_Param/AP_Param.cpp index 7d203239b8..996960a0b5 100644 --- a/libraries/AP_Param/AP_Param.cpp +++ b/libraries/AP_Param/AP_Param.cpp @@ -2369,8 +2369,7 @@ bool AP_Param::load_defaults_file(const char *filename, bool last_pass) } #endif // AP_PARAM_DEFAULTS_FILE_PARSING_ENABLED - -#if AP_PARAM_MAX_EMBEDDED_PARAM > 0 || (AP_FILESYSTEM_FILE_READING_ENABLED && defined(HAL_HAVE_AP_ROMFS_EMBEDDED_H)) +#if AP_PARAM_MAX_EMBEDDED_PARAM > 0 || defined(HAL_HAVE_AP_ROMFS_EMBEDDED_H) /* count the number of parameter defaults present in supplied string */ @@ -2416,18 +2415,6 @@ bool AP_Param::count_param_defaults(const volatile char *ptr, int32_t length, ui return true; } -#if AP_PARAM_MAX_EMBEDDED_PARAM > 0 -/* - * load a default set of parameters from a embedded parameter region - * @last_pass: if this is the last pass on defaults - unknown parameters are - * ignored but if this is set a warning will be emitted - */ -void AP_Param::load_embedded_param_defaults(bool last_pass) -{ - load_param_defaults(param_defaults_data.data, param_defaults_data.length, last_pass); -} -#endif // AP_PARAM_MAX_EMBEDDED_PARAM > 0 - /* * load parameter defaults from supplied string */ @@ -2508,7 +2495,21 @@ void AP_Param::load_param_defaults(const volatile char *ptr, int32_t length, boo } num_param_overrides = num_defaults; } -#endif // AP_PARAM_MAX_EMBEDDED_PARAM > 0 +#endif // AP_PARAM_MAX_EMBEDDED_PARAM > 0 || defined(HAL_HAVE_AP_ROMFS_EMBEDDED_H) + + +#if AP_PARAM_MAX_EMBEDDED_PARAM > 0 +/* + * load a default set of parameters from a embedded parameter region + * @last_pass: if this is the last pass on defaults - unknown parameters are + * ignored but if this is set a warning will be emitted + */ +void AP_Param::load_embedded_param_defaults(bool last_pass) +{ + load_param_defaults(param_defaults_data.data, param_defaults_data.length, last_pass); +} +#endif // AP_PARAM_MAX_EMBEDDED_PARAM > 0 + /* find a default value given a pointer to a default value in flash