ArduCopter: move logging of LandingGear event into LandingGear

Less code and Plane will get the event logged too.
This commit is contained in:
Peter Barker 2020-12-05 17:51:34 +11:00 committed by Peter Barker
parent bacbe21011
commit dac5aca40e
1 changed files with 0 additions and 14 deletions

View File

@ -9,20 +9,6 @@ void Copter::landinggear_update()
return;
}
// last status (deployed or retracted) used to check for changes, initialised to startup state of landing gear
static bool last_deploy_status = landinggear.deployed();
// send event message to datalog if status has changed
if (landinggear.deployed() != last_deploy_status) {
if (landinggear.deployed()) {
AP::logger().Write_Event(LogEvent::LANDING_GEAR_DEPLOYED);
} else {
AP::logger().Write_Event(LogEvent::LANDING_GEAR_RETRACTED);
}
}
last_deploy_status = landinggear.deployed();
// support height based triggering using rangefinder or altitude above ground
int32_t height_cm = flightmode->get_alt_above_ground_cm();