Index: firmware/App/Controllers/AlarmLamp.c =================================================================== diff -u -reb877ae36c28eb83553ee11ccccf42e2c4a5b4d2 -r07b9515c080aa68fecfa331cbc593adea4c0b8dc --- firmware/App/Controllers/AlarmLamp.c (.../AlarmLamp.c) (revision eb877ae36c28eb83553ee11ccccf42e2c4a5b4d2) +++ firmware/App/Controllers/AlarmLamp.c (.../AlarmLamp.c) (revision 07b9515c080aa68fecfa331cbc593adea4c0b8dc) @@ -14,12 +14,12 @@ * **************************************************************************/ -#include #include "Common.h" #include "CPLD.h" #include "SystemCommMessages.h" #include "TaskGeneral.h" #include "Timers.h" +#include "AlarmLamp.h" // ********** private definitions ********** @@ -33,10 +33,10 @@ // Lamp Pattern Record struct LampPatterns { - U32 duration[NUM_OF_LAMP_STATES]; // in ms - LAMP_STATE_T green[NUM_OF_LAMP_STATES]; // green lamp state 1 and 2 - LAMP_STATE_T blue[NUM_OF_LAMP_STATES]; // blue lamp state 1 and 2 - LAMP_STATE_T red[NUM_OF_LAMP_STATES]; // red lamp state 1 and 2 + U32 duration[NUM_OF_LAMP_STATES ]; // in ms + LAMP_STATE_T green[ NUM_OF_LAMP_STATES ]; // green lamp state 1 and 2 + LAMP_STATE_T blue[ NUM_OF_LAMP_STATES ]; // blue lamp state 1 and 2 + LAMP_STATE_T red[ NUM_OF_LAMP_STATES ]; // red lamp state 1 and 2 }; typedef enum Alarm_Lamp_Self_Test_States @@ -58,11 +58,11 @@ static U32 currentLampPatternStep = 0; static U32 lampPatternStepTimer = 0; -const struct LampPatterns lampPatterns[NUM_OF_LAMP_PATTERNS] = { +const struct LampPatterns lampPatterns[ NUM_OF_LAMP_PATTERNS ] = { { { 500, 500 }, { LAMP_STATE_OFF, LAMP_STATE_OFF }, { LAMP_STATE_OFF, LAMP_STATE_OFF }, { LAMP_STATE_OFF, LAMP_STATE_OFF } }, // LAMP_PATTERN_OFF { { 500, 500 }, { LAMP_STATE_ON, LAMP_STATE_ON }, { LAMP_STATE_OFF, LAMP_STATE_OFF }, { LAMP_STATE_OFF, LAMP_STATE_OFF } }, // LAMP_PATTERN_OK - { { 500, 500 }, { LAMP_STATE_OFF, LAMP_STATE_OFF }, { LAMP_STATE_OFF, LAMP_STATE_OFF }, { LAMP_STATE_ON, LAMP_STATE_OFF } }, // LAMP_PATTERN_FAULT - { { 500, 500 }, { LAMP_STATE_OFF, LAMP_STATE_OFF }, { LAMP_STATE_OFF, LAMP_STATE_OFF }, { LAMP_STATE_ON, LAMP_STATE_OFF } }, // LAMP_PATTERN_HIGH_ALARM + { { 250, 250 }, { LAMP_STATE_OFF, LAMP_STATE_OFF }, { LAMP_STATE_OFF, LAMP_STATE_OFF }, { LAMP_STATE_ON, LAMP_STATE_OFF } }, // LAMP_PATTERN_FAULT + { { 250, 250 }, { LAMP_STATE_OFF, LAMP_STATE_OFF }, { LAMP_STATE_OFF, LAMP_STATE_OFF }, { LAMP_STATE_ON, LAMP_STATE_OFF } }, // LAMP_PATTERN_HIGH_ALARM { { 1000, 1000 }, { LAMP_STATE_ON, LAMP_STATE_OFF }, { LAMP_STATE_OFF, LAMP_STATE_OFF }, { LAMP_STATE_ON, LAMP_STATE_OFF } }, // LAMP_PATTERN_MED_ALARM { { 500, 500 }, { LAMP_STATE_ON, LAMP_STATE_ON }, { LAMP_STATE_OFF, LAMP_STATE_OFF }, { LAMP_STATE_ON, LAMP_STATE_ON } }, // LAMP_PATTERN_LOW_ALARM { { 0, 0 }, { LAMP_STATE_OFF, LAMP_STATE_OFF }, { LAMP_STATE_OFF, LAMP_STATE_OFF }, { LAMP_STATE_OFF, LAMP_STATE_OFF } } // LAMP_PATTERN_MANUAL @@ -125,7 +125,7 @@ if ( getCurrentAlarmLampPattern() != LAMP_PATTERN_MANUAL ) { // if pattern step duration has elapsed, move to next step - if ( lampPatternStepTimer >= lampPatterns[getCurrentAlarmLampPattern()].duration[currentLampPatternStep] ) + if ( lampPatternStepTimer >= lampPatterns[ getCurrentAlarmLampPattern() ].duration[ currentLampPatternStep ] ) { // increment pattern step currentLampPatternStep++; @@ -156,7 +156,7 @@ } else { - // TODO - s/w fault + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_SOFTWARE_FAULT, SW_FAULT_ID_ALARM_LAMP_INVALID_PATTERN_REQUESTED, lampPattern ) } } @@ -228,8 +228,8 @@ break; default: + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_SOFTWARE_FAULT, SW_FAULT_ID_ALARM_LAMP_INVALID_SELF_TEST_STATE, alarmLampSelfTestState ) result = SELF_TEST_STATUS_FAILED; - // TODO - s/w fault break; } @@ -253,15 +253,15 @@ PIN_SIGNAL_STATE_T red = PIN_SIGNAL_LOW; lampPatternStepTimer = 0; - if ( lampPatterns[getCurrentAlarmLampPattern()].green[currentLampPatternStep] == LAMP_STATE_ON ) + if ( lampPatterns[ getCurrentAlarmLampPattern() ].green[ currentLampPatternStep ] == LAMP_STATE_ON ) { green = PIN_SIGNAL_HIGH; } - if ( lampPatterns[getCurrentAlarmLampPattern()].blue[currentLampPatternStep] == LAMP_STATE_ON ) + if ( lampPatterns[ getCurrentAlarmLampPattern() ].blue[ currentLampPatternStep ] == LAMP_STATE_ON ) { blue = PIN_SIGNAL_HIGH; } - if ( lampPatterns[getCurrentAlarmLampPattern()].red[currentLampPatternStep] == LAMP_STATE_ON ) + if ( lampPatterns[ getCurrentAlarmLampPattern() ].red[ currentLampPatternStep ] == LAMP_STATE_ON ) { red = PIN_SIGNAL_HIGH; }