Index: firmware/App/Controllers/UVReactors.c =================================================================== diff -u -r080a5f15856ba1461784d260fe09157cb77b608b -rccf1219089b835ab2f9d401c0be0d2000be9010a --- firmware/App/Controllers/UVReactors.c (.../UVReactors.c) (revision 080a5f15856ba1461784d260fe09157cb77b608b) +++ firmware/App/Controllers/UVReactors.c (.../UVReactors.c) (revision ccf1219089b835ab2f9d401c0be0d2000be9010a) @@ -58,17 +58,14 @@ static UV_REACTOR_STATUS_T reactorsStatus[ NUM_OF_UV_REACTORS ]; ///< UV reactors status array. static UV_REACTORS_SELF_TEST_STATE_T uvReactorsSelfTestStates = UV_REACTORS_SELF_TEST_OFF; ///< UV reactors self test state. -static SELF_TEST_STATUS_T uvReactosSelfTestResult = SELF_TEST_STATUS_IN_PROGRESS; ///< Valves self test result. +static SELF_TEST_STATUS_T uvReactorsSelfTestResult = SELF_TEST_STATUS_IN_PROGRESS; ///< Valves self test result. static OVERRIDE_U32_T uvReactorsDataPublishInterval = { UV_REACTORS_DATA_PUB_INTERVAL, UV_REACTORS_DATA_PUB_INTERVAL, 0, 0 }; ///< UV reactors data publish interval. static U32 dataPublishCounter = 0; ///< UV reactors data publish counter. static U32 selfTestElapsedTime = 0; ///< UV reactors self test elapsed time. -static const U32 MAX_UNHEALTHY_REACTOR_COUNT_LIMIT = MAX_ALLOWED_UNHEALTHY_REACTOR_PERIOD / - TASK_GENERAL_INTERVAL; ///< UV reactors max unhealthy count. - // Self test functions static UV_REACTORS_SELF_TEST_STATE_T handleUVReactorsSelfTestOff( void ); static UV_REACTORS_SELF_TEST_STATE_T handleUVReactorsSelfTestCheckHealth( void ); @@ -86,17 +83,17 @@ /*********************************************************************//** * @brief * The initUVReactors function initializes the UV reactors module. - * @details Inputs: uvReactosSelfTestResult, dataPublishCounter, + * @details Inputs: uvReactorsSelfTestResult, dataPublishCounter, * reactorsStatus, selfTestStates - * @details Outputs: uvReactosSelfTestResult, dataPublishCounter, + * @details Outputs: uvReactorsSelfTestResult, dataPublishCounter, * reactorsStatus, selfTestStates * @return none *************************************************************************/ void initUVReactors( void ) { UV_REACTORS_T reactor; - uvReactosSelfTestResult = SELF_TEST_STATUS_IN_PROGRESS; + uvReactorsSelfTestResult = SELF_TEST_STATUS_IN_PROGRESS; uvReactorsSelfTestStates = UV_REACTORS_SELF_TEST_OFF; dataPublishCounter = 0; @@ -116,8 +113,7 @@ reactorsStatus[ reactor ].switchState = TURN_OFF; } - initPersistentAlarm( PERSISTENT_ALARM_UV_REACTOR_UNHEALTHY, ALARM_ID_UV_REACTOR_NOT_HEALTHY, TRUE, - MAX_ALLOWED_UNHEALTHY_REACTOR_PERIOD, MAX_ALLOWED_UNHEALTHY_REACTOR_PERIOD ); + initPersistentAlarm( ALARM_ID_UV_REACTOR_NOT_HEALTHY, MAX_ALLOWED_UNHEALTHY_REACTOR_PERIOD, MAX_ALLOWED_UNHEALTHY_REACTOR_PERIOD ); } /*********************************************************************//** @@ -150,17 +146,17 @@ break; } - return uvReactosSelfTestResult; + return uvReactorsSelfTestResult; } /*********************************************************************//** * @brief - * The execUVReactos function executes the UV reactors exec states. + * The execUVReactors function executes the UV reactors exec states. * @details Inputs: reactorsStatus * @details Outputs: reactorsStatus * @return none *************************************************************************/ -void execUVReactos( void ) +void execUVReactors( void ) { UV_REACTORS_T reactor; @@ -299,8 +295,8 @@ * @brief * The handleUVReactorsSelfTestCheckHealth function handles the self test * check health state. - * @details Inputs: selfTestElapsedTime, uvReactosSelfTestResult - * @details Outputs: uvReactosSelfTestResult + * @details Inputs: selfTestElapsedTime, uvReactorsSelfTestResult + * @details Outputs: uvReactorsSelfTestResult * @return returns the next state of the self test state machine *************************************************************************/ static UV_REACTORS_SELF_TEST_STATE_T handleUVReactorsSelfTestCheckHealth( void ) @@ -316,11 +312,11 @@ // Check if both of them are healthy and if not, raise an alarm if ( TRUE == isInletHealthy && TRUE == isOutletHealthy ) { - uvReactosSelfTestResult = SELF_TEST_STATUS_PASSED; + uvReactorsSelfTestResult = SELF_TEST_STATUS_PASSED; } else { - uvReactosSelfTestResult = SELF_TEST_STATUS_FAILED; + uvReactorsSelfTestResult = SELF_TEST_STATUS_FAILED; // Check which reactor has not been healthy and raise an alarm if ( FALSE == isInletHealthy ) @@ -383,7 +379,7 @@ BOOL isReactorHealthy = getUVReactorHealth( reactor ); - checkPersistentAlarm( PERSISTENT_ALARM_UV_REACTOR_UNHEALTHY, !isReactorHealthy, (U32)reactor, MAX_UNHEALTHY_REACTOR_COUNT_LIMIT ); + checkPersistentAlarm( ALARM_ID_UV_REACTOR_NOT_HEALTHY, !isReactorHealthy, (U32)reactor, MAX_ALLOWED_UNHEALTHY_REACTOR_PERIOD ); // Check if the alarm has been active if( isAlarmActive( ALARM_ID_UV_REACTOR_NOT_HEALTHY ) )