From c67f3b574a920b15c877a969e8af725143d1ba6c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 21 Feb 2024 10:59:49 +1100 Subject: [PATCH] AP_BoardConfig: added BRD_SD_FENCE allow for fence storage on microSD --- libraries/AP_BoardConfig/AP_BoardConfig.cpp | 8 ++++++++ libraries/AP_BoardConfig/AP_BoardConfig.h | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/libraries/AP_BoardConfig/AP_BoardConfig.cpp b/libraries/AP_BoardConfig/AP_BoardConfig.cpp index 7367d34306..1457d86b62 100644 --- a/libraries/AP_BoardConfig/AP_BoardConfig.cpp +++ b/libraries/AP_BoardConfig/AP_BoardConfig.cpp @@ -354,6 +354,14 @@ const AP_Param::GroupInfo AP_BoardConfig::var_info[] = { // @RebootRequired: True // @User: Advanced AP_GROUPINFO("SD_MISSION", 24, AP_BoardConfig, sdcard_storage.mission_kb, 0), + + // @Param: SD_FENCE + // @DisplayName: SDCard Fence size + // @Description: This sets the amount of storage in kilobytes reserved on the microsd card in fence.stg for fence storage. + // @Range: 0 64 + // @RebootRequired: True + // @User: Advanced + AP_GROUPINFO("SD_FENCE", 29, AP_BoardConfig, sdcard_storage.fence_kb, 0), #endif // index 25 used by SER5_RTSCTS diff --git a/libraries/AP_BoardConfig/AP_BoardConfig.h b/libraries/AP_BoardConfig/AP_BoardConfig.h index 47bf754da4..938180a238 100644 --- a/libraries/AP_BoardConfig/AP_BoardConfig.h +++ b/libraries/AP_BoardConfig/AP_BoardConfig.h @@ -221,6 +221,11 @@ public: static uint16_t get_sdcard_mission_kb(void) { return _singleton? _singleton->sdcard_storage.mission_kb.get() : 0; } + + // return number of kb of fence storage to use on microSD + static uint16_t get_sdcard_fence_kb(void) { + return _singleton? _singleton->sdcard_storage.fence_kb.get() : 0; + } #endif private: @@ -244,6 +249,7 @@ private: #if AP_SDCARD_STORAGE_ENABLED struct { AP_Int16 mission_kb; + AP_Int16 fence_kb; } sdcard_storage; #endif