Index: Integrity.c =================================================================== diff -u -r597d414dea37e4c05518cd81b1043d2cd3fc8219 -r55d6c97f2ce3636c21b235c7a0a4ac3715f5226e --- Integrity.c (.../Integrity.c) (revision 597d414dea37e4c05518cd81b1043d2cd3fc8219) +++ Integrity.c (.../Integrity.c) (revision 55d6c97f2ce3636c21b235c7a0a4ac3715f5226e) @@ -54,8 +54,6 @@ static SELF_TEST_STATUS_T integrityTestStatus; ///< Current firmware integrity test status. static U32 processorRAMStatusCounter = 0; ///< Counter used to check processor RAM error. static BOOL singleBitRAMErrorFlag = FALSE; ///< Flag to signal the processor RAM error. -/// Time threshold to check RAM error is 2 seconds -static const U32 RAM_ERROR_CHECK_TIME_THRESHOLD = ((2 * MS_PER_SECOND) / TASK_GENERAL_INTERVAL); /*********************************************************************//** * @brief Index: PersistentAlarm.c =================================================================== diff -u -r597d414dea37e4c05518cd81b1043d2cd3fc8219 -r55d6c97f2ce3636c21b235c7a0a4ac3715f5226e --- PersistentAlarm.c (.../PersistentAlarm.c) (revision 597d414dea37e4c05518cd81b1043d2cd3fc8219) +++ PersistentAlarm.c (.../PersistentAlarm.c) (revision 55d6c97f2ce3636c21b235c7a0a4ac3715f5226e) @@ -207,6 +207,36 @@ /*********************************************************************//** * @brief + * The checkPersistentAlarm function triggers/clears an alarm if an alarm condition + * has persisted/cleared over given time limit. + * @details Inputs: none + * @details Outputs: checks whether an alarm is triggered or an alarm condition is cleared + * @param alarmID ID of alarm to check + * @param isErrorOccured Flag indicates alarm condition is active or not + * @param data alarm data + * @param limit alarm condition limit + * @return TRUE if given alarm is active, FALSE if not + *************************************************************************/ +BOOL checkPersistentAlarm( ALARM_ID_T alarm, BOOL isErrorOccured, F32 data, F32 limit ) +{ + BOOL status = FALSE; + + if ( TRUE == isPersistentAlarmTriggered( alarm, isErrorOccured ) ) + { + SET_ALARM_WITH_2_F32_DATA( alarm, data, limit ); + } + + if ( TRUE == isPersistentAlarmConditionCleared( alarm, isErrorOccured ) ) + { + clearAlarmCondition( alarm ); + status = TRUE; + } + + return status; +} + +/*********************************************************************//** + * @brief * The resetPersistentAlarmTimer function resets the start time for error * condition clear start time and error start time. * @details Inputs: none @@ -319,44 +349,4 @@ return isPersistentTriggered; } -void checkFPGAPersistentAlarms( FPGA_PERSISTENT_ALARMS_GROUP_T group, U32 errorCount, U32 readCount, U32 sensorIndex ) -{ - if ( group < NUM_OF_FPGA_SENSOR_GROUPS ) - { - FPGA_ERROR_TYPE_T type = NUM_OF_FPGA_ERROR_TYPES; - BOOL isPersistenceTrgrd = FALSE; - FPGA_ALARM_DATA_T readData = fpgaPersistentAlarmGroup[ group ].fpgaAlarmData[ FPGA_READ_ERROR ]; - FPGA_ALARM_DATA_T errorData = fpgaPersistentAlarmGroup[ group ].fpgaAlarmData[ FPGA_ERROR_ERROR ]; - - if ( ( readCount == readData.fpgaPreviousCount ) && ( errorCount == errorData.fpgaPreviousCount ) ) - { - type = FPGA_NOT_UPDATING_ERROR; - isPersistenceTrgrd = isFPGAPersistentAlarmTriggered( &fpgaPersistentAlarmGroup[ group ], readCount, FPGA_NOT_UPDATING_ERROR ); - } - else if ( readData.fpgaPreviousCount != readCount ) - { - type = FPGA_READ_ERROR; - isPersistenceTrgrd = isFPGAPersistentAlarmTriggered( &fpgaPersistentAlarmGroup[ group ], readCount, FPGA_READ_ERROR ); - } - else if ( errorData.fpgaPreviousCount != errorCount ) - { - type = FPGA_ERROR_ERROR; - isPersistenceTrgrd = isFPGAPersistentAlarmTriggered( &fpgaPersistentAlarmGroup[ group ], errorCount, FPGA_ERROR_ERROR ); - } - - if ( TRUE == isPersistenceTrgrd ) - { - SET_ALARM_WITH_2_U32_DATA( fpgaPersistentAlarmGroup[ group ].fpgaAlarm, type, sensorIndex ); - } - } - else - { -#ifdef _DG_ - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_FPGA_SENSOR_GROUP_SELECTED, (U32)group ); -#endif -#ifdef _HD_ - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_FPGA_SENSOR_GROUP_SELECTED, (U32)group ); -#endif } -} - /**@}*/ Index: PersistentAlarm.h =================================================================== diff -u -r07779aa6f22d6e376b83d3e4002b9d7bd5890e35 -r55d6c97f2ce3636c21b235c7a0a4ac3715f5226e --- PersistentAlarm.h (.../PersistentAlarm.h) (revision 07779aa6f22d6e376b83d3e4002b9d7bd5890e35) +++ PersistentAlarm.h (.../PersistentAlarm.h) (revision 55d6c97f2ce3636c21b235c7a0a4ac3715f5226e) @@ -63,9 +63,10 @@ BOOL isPersistentAlarmTriggered( ALARM_ID_T alarmIndex, BOOL const isErrorOccurred ); BOOL isPersistentAlarmConditionCleared( ALARM_ID_T alarmIndex, BOOL const isErrorOccurred ); +BOOL checkPersistentAlarm( ALARM_ID_T alarm, BOOL isErrorOccured, F32 data, F32 limit ); void resetPersistentAlarmTimer( ALARM_ID_T alarmId ); -void checkFPGAPersistentAlarms( FPGA_PERSISTENT_ALARMS_GROUP_T group, U32 errorCount, U32 readCount, U32 sensorIndex ); +void checkFPGAPersistentAlarms( FPGA_PERSISTENT_ALARMS_GROUP_T group, U32 errorCount, U32 readCount ); /**@}*/