From 26893554c07b4bdc6a0a6f7c594e5078524fd3d2 Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Mon, 9 Feb 2015 00:50:22 +0100 Subject: [PATCH] OP-1704 - Change Hook alarm level to Critical to prevent arming and allow them to be disabled with DisableSanityChecks --- flight/libraries/sanitycheck.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 {