OP-1156 fix path logic to not deviate from correct altitude too much
[librepilot.git] / flight / modules / Airspeed / airspeedalarm.c
blobc14b62ca18733a46c0f26f05f524b86880eee768
1 /**
2 ******************************************************************************
3 * @addtogroup OpenPilotModules OpenPilot Modules
4 * @{
5 * @addtogroup AirspeedModule Airspeed Module
6 * @brief Handle locally airspeed alarms issue changes to PIOS only when necessary
7 * @{
9 * @file airspeedalarm.c
10 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2014.
11 * @brief Airspeed module
13 * @see The GNU Public License (GPL) Version 3
15 *****************************************************************************/
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 3 of the License, or
20 * (at your option) any later version.
22 * This program is distributed in the hope that it will be useful, but
23 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
24 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
25 * for more details.
27 * You should have received a copy of the GNU General Public License along
28 * with this program; if not, write to the Free Software Foundation, Inc.,
29 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 /**
33 * Output object: none
35 * Handle locally airspeed alarms issue changes to PIOS only when necessary
39 #include "airspeedalarm.h"
41 // local variable
43 static SystemAlarmsAlarmOptions severitySet = SYSTEMALARMS_ALARM_UNINITIALISED;
45 // functions
47 /**
48 * Handle airspeed alarms and isuue an Alarm to PIOS only if necessary
50 bool AirspeedAlarm(SystemAlarmsAlarmOptions severity)
52 if (severity == severitySet) {
53 return false;
56 severitySet = severity;
58 return AlarmsSet(SYSTEMALARMS_ALARM_AIRSPEED, severity) == 0;
62 /**
63 * @}
64 * @}