Index: firmware/App/Controllers/Voltages.c =================================================================== diff -u -r59cf08219009465e2321b8c0b7a8c4912f5afd75 -ra424e03cb4e42d62420d66e30c2a4e5b82ee4213 --- firmware/App/Controllers/Voltages.c (.../Voltages.c) (revision 59cf08219009465e2321b8c0b7a8c4912f5afd75) +++ firmware/App/Controllers/Voltages.c (.../Voltages.c) (revision a424e03cb4e42d62420d66e30c2a4e5b82ee4213) @@ -36,7 +36,6 @@ #define VOLTAGES_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the voltages data is published on the CAN bus. #define VOLTAGES_ALARM_PERSISTENCE_MS ( 1 * MS_PER_SECOND ) ///< Alarm persistence period for voltage monitor alarms in milliseconds. #define POWER_LOSS_VOLTAGE_PERSISTENCE_MS 150 ///< Power supply voltage out of range persistence in milliseconds. -#define POWER_LOSS_VOLTAGE_THRESHOLD_V 5.0F ///< Power loss voltage threshold #define DATA_PUBLISH_COUNTER_START_COUNT 14 ///< Data publish counter start count. /// Defined states for the voltage monitor state machine. @@ -207,20 +206,11 @@ { MONITORED_VOLTAGES_T channel; MONITORED_VOLTAGES_T channelInAlarm; - BOOL hasPowerBeenLost = FALSE; + BOOL hasPowerBeenLost = getCPLDACPowerLossDetected(); BOOL isVoltageOutOfRange = FALSE; F32 volts = 0.0F; F32 alarmVoltage = 0.0F; - // Have we lost AC power? TODO - replace with CPLD status check - if ( getMonitoredLineLevel( MONITORED_LINE_24V ) < POWER_LOSS_VOLTAGE_THRESHOLD_V ) - { - if ( ( getCurrentOperationMode() != MODE_INIT ) && ( FALSE == isSafetyShutdownActivated() ) ) - { - hasPowerBeenLost = TRUE; - } - } - // Check range for ( channel = MONITORED_LINE_FIRST_VOLTAGE; channel < NUM_OF_MONITORED_LINES; channel++ ) { @@ -237,8 +227,7 @@ isVoltageOutOfRange = TRUE; channelInAlarm = channel; alarmVoltage = volts; - break; // once a channel is out of range there is - // no need to continue + break; // once a channel is out of range there is no need to continue } } } @@ -247,7 +236,7 @@ // Check the persistence alarm checkPersistentAlarm ( ALARM_ID_HD_VOLTAGE_OUT_OF_RANGE, isVoltageOutOfRange, channelInAlarm, alarmVoltage ); - if ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_AC_POWER_LOST, hasPowerBeenLost ) ) + if ( TRUE == hasPowerBeenLost ) { HD_OP_MODE_T opMode = getCurrentOperationMode();