mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 00:28:30 -04:00
ArduCopter: move logging of LandingGear event into LandingGear
Less code and Plane will get the event logged too.
This commit is contained in:
parent
bacbe21011
commit
dac5aca40e
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user