AP_HAL_ChibiOS: add support for storing OpenDroneID in bootloader sector

This commit is contained in:
bugobliterator
2023-06-17 14:49:22 +10:00
committed by Peter Barker
parent 5825ab4dc6
commit 0850ea6b61
3 changed files with 34 additions and 5 deletions
+8
View File
@@ -34,6 +34,7 @@
#endif
#if HAL_ENABLE_SAVE_PERSISTENT_PARAMS
#include <AP_InertialSensor/AP_InertialSensor.h>
#include <AP_OpenDroneID/AP_OpenDroneID.h>
#endif
#ifndef HAL_BOOTLOADER_BUILD
#include <AP_Logger/AP_Logger.h>
@@ -49,6 +50,7 @@ extern AP_IOMCU iomcu;
#include <AP_CheckFirmware/AP_CheckFirmware.h>
#endif
extern const AP_HAL::HAL& hal;
using namespace ChibiOS;
@@ -531,6 +533,12 @@ bool Util::get_persistent_params(ExpandingString &str) const
if (ins) {
ins->get_persistent_params(str);
}
#endif
#if AP_OPENDRONEID_ENABLED
const auto *odid = AP_OpenDroneID::get_singleton();
if (odid) {
odid->get_persistent_params(str);
}
#endif
if (str.has_failed_allocation() || str.get_length() <= strlen(persistent_header)) {
// no data