Plane: Allow a second activation of parachute

The hardware can fail in the first activation,
this patch allow a second chance to active the parachute successfully.

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
This commit is contained in:
Patrick José Pereira 2017-07-26 09:29:42 -03:00 committed by Francisco Ferreira
parent 1eeea82e31
commit 60834e9af0

View File

@ -18,12 +18,15 @@ void Plane::parachute_check()
*/ */
void Plane::parachute_release() void Plane::parachute_release()
{ {
if (parachute.released()) { if (parachute.release_in_progress()) {
return; return;
} }
// send message to gcs and dataflash // send message to gcs and dataflash
if (parachute.released()) {
gcs().send_text(MAV_SEVERITY_CRITICAL,"Parachute: Released again");
} else {
gcs().send_text(MAV_SEVERITY_CRITICAL,"Parachute: Released"); gcs().send_text(MAV_SEVERITY_CRITICAL,"Parachute: Released");
}
// release parachute // release parachute
parachute.release(); parachute.release();