Parachute: clear release time when enabled

This resolves an issue in which the parachute could be suddenly released
when the user enabled the parachute.  The sequence that could have
caused this bad behaviour were (1) the parachute is triggered (2) the
user disables the parachute in the 0.5sec between the trigger and the
actual release, (3) the user re-enables the parachute and the old
release time from (1) is used.
This commit is contained in:
Randy Mackay 2014-04-24 19:20:04 +09:00
parent 19f1e7fec4
commit 06bef6e3b8

View File

@ -60,10 +60,8 @@ void AP_Parachute::enabled(bool on_off)
{
_enabled = on_off;
// if disabled clear release_time
if (_enabled <= 0) {
_release_time = 0;
}
// clear release_time
_release_time = 0;
}
/// release - release parachute