Index: firmware/App/Services/WatchdogMgmt.c =================================================================== diff -u -rf3326a3d0fd2a465a518e31ee578e335db301c27 -r58f8416a9ff9c68ee34361ac23a46dcf56cfa79e --- firmware/App/Services/WatchdogMgmt.c (.../WatchdogMgmt.c) (revision f3326a3d0fd2a465a518e31ee578e335db301c27) +++ firmware/App/Services/WatchdogMgmt.c (.../WatchdogMgmt.c) (revision 58f8416a9ff9c68ee34361ac23a46dcf56cfa79e) @@ -16,6 +16,7 @@ ***************************************************************************/ #include "CPLD.h" +#include "FPGA.h" #include "InternalADC.h" #include "SafetyShutdown.h" #include "SystemCommMessages.h" @@ -30,11 +31,11 @@ // ********** private definitions ********** #define MIN_WATCHDOG_PET_INTERVAL_MS 45 ///< Minimum watchdog pet interval (in ms). -#define WATCHDOG_POST_TIMEOUT_MS 100 ///< Watchdog POST test timeout (in ms). +#define WATCHDOG_POST_TIMEOUT_MS 500 ///< Watchdog POST test timeout (in ms). #define WATCHDOG_RECOVERY_TIME_MS 250 ///< After watchdog POST test, wait this long (in ms) before moving on. -#define MAX_24V_LEVEL_ON_WATCHDOG_EXPIRED 1.0 ///< Maximum voltage on 24V line when watchdog is expired. -#define MIN_BACKUP_ALARM_CURRENT 10.0 ///< Minimum backup alarm audio current (in mA) detected when watchdog is expired. +#define MAX_24V_LEVEL_ON_WATCHDOG_EXPIRED 5.0 ///< Maximum voltage on 24V line when watchdog is expired. // TODO - check w/ Systems. Takes time for V to bleed off. Had to raise to 5V. +#define MIN_BACKUP_ALARM_CURRENT_MA 200.0 ///< Minimum backup alarm audio current (in mA) detected when watchdog is expired. /// Enumeration of watchdog self-test states. typedef enum Watchdog_Self_Test_States @@ -124,7 +125,6 @@ } } - /*********************************************************************//** * @brief * The checkInWithWatchdogMgmt function checks a given task in with the @@ -168,23 +168,32 @@ // Waiting here for w.d. test period to prevent this task from checking in - watchdog should expire } if ( getCPLDWatchdogExpired() == PIN_SIGNAL_HIGH ) - { + { + F32 v24 = getIntADCVoltageConverted( INT_ADC_24V_ACTUATORS ); + F32 audioCurrent = getFPGABackupAlarmAudioCurrent(); + // Verify 24V is down when w.d. expired - if ( getIntADCVoltageConverted( INT_ADC_24V_ACTUATORS ) > MAX_24V_LEVEL_ON_WATCHDOG_EXPIRED ) + if ( v24 > MAX_24V_LEVEL_ON_WATCHDOG_EXPIRED ) { - // TODO - alarm + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_HD_WATCHDOG_POST_TEST_FAILED, 2.0, v24 ); + watchdogSelfTestStatus = SELF_TEST_STATUS_FAILED; } +#ifndef DISABLE_ALARM_AUDIO // Verify backup alarm audio is on when w.d. expired - if ( getIntADCVoltageConverted( INT_ADC_BACKUP_ALARM_CURRENT ) < MIN_BACKUP_ALARM_CURRENT ) + else if ( audioCurrent < MIN_BACKUP_ALARM_CURRENT_MA ) { - // TODO - alarm + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_WATCHDOG_POST_TEST_FAILED, 3.0, audioCurrent ); + watchdogSelfTestStatus = SELF_TEST_STATUS_FAILED; } - // TODO - user needs to verify backup alarm audio and LED? - watchdogSelfTestStatus = SELF_TEST_STATUS_PASSED; +#endif + else + { + watchdogSelfTestStatus = SELF_TEST_STATUS_PASSED; + } } else { - activateAlarmNoData( ALARM_ID_WATCHDOG_POST_TEST_FAILED ); + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_WATCHDOG_POST_TEST_FAILED, 1 ); watchdogSelfTestStatus = SELF_TEST_STATUS_FAILED; } watchdogSelfTestTimerCount = getMSTimerCount();