Copter: update brake-timeout to work with master

We added mode-change reasons since PR was submitted
This commit is contained in:
Randy Mackay 2016-05-13 11:39:37 +09:00
parent 0a2336a5a8
commit cfb2a6b2f9
2 changed files with 5 additions and 5 deletions

View File

@ -78,10 +78,9 @@ void Copter::brake_run()
pos_control.set_alt_target_from_climb_rate_ff(0.0f, G_Dt, false); pos_control.set_alt_target_from_climb_rate_ff(0.0f, G_Dt, false);
pos_control.update_z_controller(); pos_control.update_z_controller();
if (brake_timeout_ms != 0 && millis()-brake_timeout_start >= brake_timeout_ms) if (brake_timeout_ms != 0 && millis()-brake_timeout_start >= brake_timeout_ms) {
{ if (!set_mode(LOITER, MODE_REASON_BRAKE_TIMEOUT)) {
if(!set_mode(LOITER)) { set_mode(ALT_HOLD, MODE_REASON_BRAKE_TIMEOUT);
set_mode(ALT_HOLD);
} }
} }
} }

View File

@ -118,7 +118,8 @@ enum mode_reason_t {
MODE_REASON_MISSION_END, MODE_REASON_MISSION_END,
MODE_REASON_THROTTLE_LAND_ESCAPE, MODE_REASON_THROTTLE_LAND_ESCAPE,
MODE_REASON_FENCE_BREACH, MODE_REASON_FENCE_BREACH,
MODE_REASON_TERRAIN_FAILSAFE MODE_REASON_TERRAIN_FAILSAFE,
MODE_REASON_BRAKE_TIMEOUT
}; };
// Tuning enumeration // Tuning enumeration