mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
OP-1302 Remove the special case for Telemetry in Alarm.c and shut up the telemetry warning in telemetry.c when disconnected
This commit is contained in:
parent
ee91207ede
commit
d42debba50
@ -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 (n != SYSTEMALARMS_ALARM_TELEMETRY && cast_struct_to_array(alarms, alarms.Actuator)[n] >= severity) {
|
||||
if (cast_struct_to_array(alarms, alarms.Actuator)[n] >= severity) {
|
||||
xSemaphoreGiveRecursive(lock);
|
||||
return 1;
|
||||
}
|
||||
@ -272,8 +272,7 @@ SystemAlarmsAlarmOptions AlarmsGetHighestSeverity()
|
||||
// Go through alarms and find the highest severity
|
||||
uint32_t n = 0;
|
||||
while (n < SYSTEMALARMS_ALARM_NUMELEM && highest != SYSTEMALARMS_ALARM_CRITICAL) {
|
||||
if (n != SYSTEMALARMS_ALARM_TELEMETRY &&
|
||||
cast_struct_to_array(alarmsData, alarmsData.Actuator)[n] > highest) {
|
||||
if (cast_struct_to_array(alarmsData, alarmsData.Actuator)[n] > highest) {
|
||||
highest = cast_struct_to_array(alarmsData, alarmsData.Actuator)[n];
|
||||
}
|
||||
n++;
|
||||
|
@ -650,11 +650,10 @@ static void updateTelemetryStats()
|
||||
flightStats.Status = FLIGHTTELEMETRYSTATS_STATUS_DISCONNECTED;
|
||||
}
|
||||
|
||||
// Update the telemetry alarm
|
||||
// TODO: check whether is there any error condition worth raising an alarm
|
||||
// Disconnection is actually a normal (non)working status so it is not raising alarms anymore.
|
||||
if (flightStats.Status == FLIGHTTELEMETRYSTATS_STATUS_CONNECTED) {
|
||||
AlarmsClear(SYSTEMALARMS_ALARM_TELEMETRY);
|
||||
} else {
|
||||
AlarmsSet(SYSTEMALARMS_ALARM_TELEMETRY, SYSTEMALARMS_ALARM_ERROR);
|
||||
}
|
||||
|
||||
// Update object
|
||||
|
Loading…
x
Reference in New Issue
Block a user