mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-06 19:00:27 +08:00
AP_HAL_ChibiOS: add support for storing OpenDroneID in bootloader sector
This commit is contained in:
committed by
Peter Barker
parent
5825ab4dc6
commit
0850ea6b61
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user