mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-30 15:52:12 +01:00
OP-1704 - Change Hook alarm level to Critical to prevent arming and allow them to be disabled with DisableSanityChecks
This commit is contained in:
parent
a4da83a1be
commit
26893554c0
@ -178,26 +178,26 @@ int32_t configuration_check()
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t checks_disabled;
|
||||
FlightModeSettingsDisableSanityChecksGet(&checks_disabled);
|
||||
if (checks_disabled == FLIGHTMODESETTINGS_DISABLESANITYCHECKS_TRUE) {
|
||||
severity = SYSTEMALARMS_ALARM_WARNING;
|
||||
}
|
||||
|
||||
// query sanity check hooks
|
||||
if (severity == SYSTEMALARMS_ALARM_OK) {
|
||||
if (severity < SYSTEMALARMS_ALARM_CRITICAL) {
|
||||
SANITYCHECK_CustomHookInstance *instance = NULL;
|
||||
LL_FOREACH(hooks, instance) {
|
||||
if (instance->enabled) {
|
||||
alarmstatus = instance->hook();
|
||||
if (alarmstatus != SYSTEMALARMS_EXTENDEDALARMSTATUS_NONE) {
|
||||
severity = SYSTEMALARMS_ALARM_WARNING;
|
||||
severity = SYSTEMALARMS_ALARM_CRITICAL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t checks_disabled;
|
||||
FlightModeSettingsDisableSanityChecksGet(&checks_disabled);
|
||||
if (checks_disabled == FLIGHTMODESETTINGS_DISABLESANITYCHECKS_TRUE) {
|
||||
severity = SYSTEMALARMS_ALARM_WARNING;
|
||||
}
|
||||
|
||||
if (severity != SYSTEMALARMS_ALARM_OK) {
|
||||
ExtendedAlarmsSet(SYSTEMALARMS_ALARM_SYSTEMCONFIGURATION, severity, alarmstatus, alarmsubstatus);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user