AP_AHRS: move logging of LogEvent::SET_HOME up

This commit is contained in:
Peter Barker 2022-01-30 16:48:06 +11:00 committed by Andrew Tridgell
parent 408491ddd5
commit f72024fc63
1 changed files with 8 additions and 0 deletions

View File

@ -25,6 +25,7 @@
#include <GCS_MAVLink/GCS.h>
#include <AP_GPS/AP_GPS.h>
#include <AP_Baro/AP_Baro.h>
#include <AP_Logger/AP_Logger.h>
extern const AP_HAL::HAL& hal;
@ -1157,6 +1158,13 @@ bool AP_AHRS::set_home(const Location &loc)
return false;
}
#if !APM_BUILD_TYPE(APM_BUILD_UNKNOWN)
if (!_home_is_set) {
// record home is set
AP::logger().Write_Event(LogEvent::SET_HOME);
}
#endif
_home = tmp;
_home_is_set = true;