Index: firmware/App/Controllers/Fans.c =================================================================== diff -u -r46b163d19c65e8c21db7b0247bbb1af0dba1ece5 -rc4597167d133bcafd1a0576d0f7c53f430d98d4b --- firmware/App/Controllers/Fans.c (.../Fans.c) (revision 46b163d19c65e8c21db7b0247bbb1af0dba1ece5) +++ firmware/App/Controllers/Fans.c (.../Fans.c) (revision c4597167d133bcafd1a0576d0f7c53f430d98d4b) @@ -59,7 +59,7 @@ /// Fans exec states typedef enum fans_Exec_States { - FANS_EXEC_STATE_WAIT_FOR_POST_STATE = 0, ///< Fans exec state start state. + FANS_EXEC_STATE_START = 0, ///< Fans exec state start state. FANS_EXEC_STATE_RUN_STATE, ///< Fans exec state run state. NUM_OF_FANS_EXEC_STATES, ///< Number of fans exec states. } FANS_EXEC_STATES_T; @@ -76,7 +76,6 @@ static FANS_EXEC_STATES_T fansExecState; ///< Fans exec state. static U32 fansControlCounter; ///< Fans control interval counter. static U32 fansPublishCounter; ///< Fans data publish interval counter. -static BOOL isPOSTComplete; ///< Flag that indicates whether POST is complete or not. static BOOL hasAlarmBeenRaised; ///< Flag that indicates whether RPM out of range alarm has been raised once. static U32 rpmAlarmStartTimeOffset; ///< RPM out of range alarm start time offset. static S32 rpmAlarmStartTime; ///< RPM alarm start time. @@ -90,7 +89,7 @@ static OVERRIDE_U32_T fansPublishInterval = { FANS_DATA_PUBLISH_INTERVAL, FANS_DATA_PUBLISH_INTERVAL, 0, 0 }; ///< Fans publish time interval override -static FANS_EXEC_STATES_T handleExecStateWaitForPOST( void ); +static FANS_EXEC_STATES_T handleExecStateStart( void ); static FANS_EXEC_STATES_T handleExecStateRun( void ); static void setInletFansDutyCycle( F32 pwm ); @@ -105,7 +104,7 @@ * The initFans function initializes the fans module. * @details Inputs: none * @details Outputs: fansExecState, fansControlCounter, - * fansPublishCounter, isPOSTComplete, hasAlarmBeenRaised, fansStatus, + * fansPublishCounter, hasAlarmBeenRaised, fansStatus, * rpmAlarmStartTime, rpmAlarmStartTimeOffset * @return none *************************************************************************/ @@ -114,10 +113,9 @@ FAN_NAMES_T fan; // Initialize the variables - fansExecState = FANS_EXEC_STATE_WAIT_FOR_POST_STATE; + fansExecState = FANS_EXEC_STATE_START; fansControlCounter = 0; fansPublishCounter = DATA_PUBLISH_COUNTER_START_COUNT; - isPOSTComplete = FALSE; hasAlarmBeenRaised = FALSE; rpmAlarmStartTime = 0; rpmAlarmStartTimeOffset = 0; @@ -153,8 +151,6 @@ // TODO implement the calibration processing function. // It returns a pass for now - - isPOSTComplete = TRUE; status = SELF_TEST_STATUS_PASSED; return status; @@ -171,8 +167,8 @@ { switch ( fansExecState ) { - case FANS_EXEC_STATE_WAIT_FOR_POST_STATE: - fansExecState = handleExecStateWaitForPOST(); + case FANS_EXEC_STATE_START: + fansExecState = handleExecStateStart(); break; case FANS_EXEC_STATE_RUN_STATE: @@ -234,17 +230,12 @@ * @details Outputs: none * @return the next state of the exec state machine *************************************************************************/ -static FANS_EXEC_STATES_T handleExecStateWaitForPOST( void ) +static FANS_EXEC_STATES_T handleExecStateStart( void ) { - FANS_EXEC_STATES_T state = FANS_EXEC_STATE_WAIT_FOR_POST_STATE; + FANS_EXEC_STATES_T state = FANS_EXEC_STATE_RUN_STATE; - // Wait for the self test to finish before starting the fans - if ( TRUE == isPOSTComplete ) - { - // Start the fans with minimum PWM. The control will decide the next PWM automatically. - setInletFansDutyCycle( FANS_MIN_DUTY_CYCLE ); - state = FANS_EXEC_STATE_RUN_STATE; - } + // Start the fans with minimum PWM. The control will decide the next PWM automatically. + setInletFansDutyCycle( FANS_MIN_DUTY_CYCLE ); return state; } @@ -428,10 +419,8 @@ isFanRPMOutOfRange |= ( ( rpm < fansMinAllowedRPM ) || ( rpm > fansMaxAllowedRPM ) ? TRUE : FALSE ); } - // Check if the alarm has not been raise yet, raise it then - // Before checking for the alarm, the POST must be completed. The fans POST is after the temperatures POST that should get their - // calibration to be able to apply them and calculate the temperatures that are used to alarm the fans. - if ( ( FALSE == hasAlarmBeenRaised ) && ( TRUE == isPOSTComplete ) ) + // If the fans alarm has been raised already, do not raise again + if ( FALSE == hasAlarmBeenRaised ) { isAlarmTriggered = isPersistentAlarmTriggered( ALARM_ID_HD_FAN_RPM_OUT_OF_RANGE, isFanRPMOutOfRange );