1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-30 15:52:12 +01:00

OP-1302 filter out telemetry alarms

This commit is contained in:
Alessio Morale 2014-04-12 22:00:26 +02:00
parent 82c81fef6e
commit 9ebb66fbce

View File

@ -244,7 +244,7 @@ static int32_t hasSeverity(SystemAlarmsAlarmOptions severity)
// Go through alarms and check if any are of the given severity or higher
for (uint32_t n = 0; n < SYSTEMALARMS_ALARM_NUMELEM; ++n) {
if (cast_struct_to_array(alarms, alarms.Actuator)[n] >= severity) {
if (n != SYSTEMALARMS_ALARM_TELEMETRY && cast_struct_to_array(alarms, alarms.Actuator)[n] >= severity) {
xSemaphoreGiveRecursive(lock);
return 1;
}
@ -272,7 +272,8 @@ SystemAlarmsAlarmOptions AlarmsGetHighestSeverity()
// Go through alarms and find the highest severity
uint32_t n = 0;
while (n < SYSTEMALARMS_ALARM_NUMELEM && highest != SYSTEMALARMS_ALARM_CRITICAL) {
if (cast_struct_to_array(alarmsData, alarmsData.Actuator)[n] > highest) {
if (n != SYSTEMALARMS_ALARM_TELEMETRY &&
cast_struct_to_array(alarmsData, alarmsData.Actuator)[n] > highest) {
highest = cast_struct_to_array(alarmsData, alarmsData.Actuator)[n];
}
n++;