mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-12 02:48:28 -04:00
2c38e31c93
The PSTR is already define as a NOP for all supported platforms. It's only needed for AVR so here we remove all the uses throughout the codebase. This was automated with a simple python script so it also converts places which spans to multiple lines, removing the matching parentheses. AVR-specific places were not changed.
59 lines
1.3 KiB
C++
59 lines
1.3 KiB
C++
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
|
|
|
#include "Plane.h"
|
|
|
|
|
|
/*
|
|
call parachute library update
|
|
*/
|
|
void Plane::parachute_check()
|
|
{
|
|
parachute.update();
|
|
}
|
|
|
|
/*
|
|
parachute_release - trigger the release of the parachute
|
|
*/
|
|
void Plane::parachute_release()
|
|
{
|
|
if (parachute.released()) {
|
|
return;
|
|
}
|
|
|
|
// send message to gcs and dataflash
|
|
gcs_send_text_P(MAV_SEVERITY_CRITICAL,"Parachute: Released");
|
|
|
|
// release parachute
|
|
parachute.release();
|
|
}
|
|
|
|
/*
|
|
parachute_manual_release - trigger the release of the parachute,
|
|
after performing some checks for pilot error checks if the vehicle
|
|
is landed
|
|
*/
|
|
bool Plane::parachute_manual_release()
|
|
{
|
|
// exit immediately if parachute is not enabled
|
|
if (!parachute.enabled() || parachute.released()) {
|
|
return false;
|
|
}
|
|
|
|
// do not release if vehicle is not flying
|
|
if (!is_flying()) {
|
|
// warn user of reason for failure
|
|
gcs_send_text_P(MAV_SEVERITY_WARNING,"Parachute: not flying");
|
|
return false;
|
|
}
|
|
|
|
if (relative_altitude() < parachute.alt_min()) {
|
|
gcs_send_text_fmt("Parachute: too low");
|
|
return false;
|
|
}
|
|
|
|
// if we get this far release parachute
|
|
parachute_release();
|
|
|
|
return true;
|
|
}
|