diff --git a/flight/libraries/sanitycheck.c b/flight/libraries/sanitycheck.c index 61950cbd9..b84b4f7a0 100644 --- a/flight/libraries/sanitycheck.c +++ b/flight/libraries/sanitycheck.c @@ -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 {