1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

LP-608 Allow min/max altitude recording for standalone board without inputs

This commit is contained in:
Laurent Lalanne 2019-02-16 12:53:36 +01:00
parent 14a7e7a7cf
commit aec8e7992e

View File

@ -658,8 +658,9 @@ void update_telemetrydata()
// calculate altitude relative to start position
telestate->altitude = -telestate->Position.Down;
// check and set min/max values when armed.
if (telestate->FlightStatus.Armed == FLIGHTSTATUS_ARMED_ARMED) {
// check and set min/max values when armed
// and without receiver input for standalone board used as sensor
if ((telestate->FlightStatus.Armed == FLIGHTSTATUS_ARMED_ARMED) || ((telestate->SysAlarms.Alarm.Attitude == SYSTEMALARMS_ALARM_OK) && (telestate->SysAlarms.Alarm.Receiver != SYSTEMALARMS_ALARM_OK))) {
if (telestate->min_altitude > telestate->altitude) {
telestate->min_altitude = telestate->altitude;
}