Copter: add comments to set_land_complete

This commit is contained in:
Randy Mackay 2016-05-13 12:01:38 +09:00
parent 747344a8ba
commit 0732ad3957

View File

@ -79,6 +79,7 @@ void Copter::update_land_detector()
set_land_complete_maybe(ap.land_complete || (land_detector_count >= LAND_DETECTOR_MAYBE_TRIGGER_SEC*MAIN_LOOP_RATE)); set_land_complete_maybe(ap.land_complete || (land_detector_count >= LAND_DETECTOR_MAYBE_TRIGGER_SEC*MAIN_LOOP_RATE));
} }
// set land_complete flag and disarm motors if disarm-on-land is configured
void Copter::set_land_complete(bool b) void Copter::set_land_complete(bool b)
{ {
// if no change, exit immediately // if no change, exit immediately
@ -94,6 +95,7 @@ void Copter::set_land_complete(bool b)
} }
ap.land_complete = b; ap.land_complete = b;
// trigger disarm-on-land if configured
bool disarm_on_land_configured = (g.throttle_behavior & THR_BEHAVE_DISARM_ON_LAND_DETECT) != 0; bool disarm_on_land_configured = (g.throttle_behavior & THR_BEHAVE_DISARM_ON_LAND_DETECT) != 0;
bool mode_disarms_on_land = mode_allows_arming(control_mode,false) && !mode_has_manual_throttle(control_mode); bool mode_disarms_on_land = mode_allows_arming(control_mode,false) && !mode_has_manual_throttle(control_mode);