Browse Source

AP_DAL: guarantee that the beacon count cannot change after startup

zr-v5.1
Andrew Tridgell 4 years ago
parent
commit
7b08053ef2
  1. 6
      libraries/AP_DAL/AP_DAL_Beacon.cpp

6
libraries/AP_DAL/AP_DAL_Beacon.cpp

@ -7,9 +7,13 @@ @@ -7,9 +7,13 @@
AP_DAL_Beacon::AP_DAL_Beacon()
{
#if !APM_BUILD_TYPE(APM_BUILD_AP_DAL_Standalone) && !APM_BUILD_TYPE(APM_BUILD_Replay)
const auto *bcon = AP::beacon();
_RBCH.count = bcon->count();
for (uint8_t i=0; i<ARRAY_SIZE(_RBCI); i++) {
_RBCI[i].instance = i;
}
#endif
}
void AP_DAL_Beacon::start_frame()
@ -18,9 +22,7 @@ void AP_DAL_Beacon::start_frame() @@ -18,9 +22,7 @@ void AP_DAL_Beacon::start_frame()
const log_RBCH old = _RBCH;
if (bcon != nullptr) {
_RBCH.count = bcon->count();
_RBCH.get_vehicle_position_ned_returncode = bcon->get_vehicle_position_ned(_RBCH.vehicle_position_ned, _RBCH.accuracy_estimate);
Location loc;
_RBCH.get_origin_returncode = bcon->get_origin(loc);
_RBCH.enabled = bcon->enabled();

Loading…
Cancel
Save