Index: firmware/App/Controllers/Fans.c =================================================================== diff -u -r2e21405574597474db0ebae86cdd7fa2d517f71c -rad6b3443575d3f6bbac52237866e19a212d36bc1 --- firmware/App/Controllers/Fans.c (.../Fans.c) (revision 2e21405574597474db0ebae86cdd7fa2d517f71c) +++ firmware/App/Controllers/Fans.c (.../Fans.c) (revision ad6b3443575d3f6bbac52237866e19a212d36bc1) @@ -62,7 +62,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; @@ -78,13 +78,12 @@ // ********** private data ********** static FAN_STATUS_T fansStatus; ///< Fans status. -static FANS_EXEC_STATES_T fansExecState = FANS_EXEC_STATE_WAIT_FOR_POST_STATE; ///< Fans exec state. -static U32 fansControlCounter = 0; ///< Fans control interval counter. +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 = FALSE; ///< Flag that indicates whether POST is complete or not. -static BOOL hasAlarmBeenRaised = FALSE; ///< Flag that indicates whether the RPM out of range alarm been raise. +static BOOL hasAlarmBeenRaised; ///< Flag that indicates whether the RPM out of range alarm been raise. static U32 rpmAlarmStartTimeOffset; ///< RPM out of range alarm start time offset. -static U32 rpmAlarmStartTime = 0; ///< RPM alarm start time. +static U32 rpmAlarmStartTime; ///< RPM alarm start time. static DG_FANS_CAL_RECORD_T fansCalReocrd; ///< Fans calibration record. /// Temperature to duty cycle conversion slope (duty cycle not in percent) @@ -97,7 +96,7 @@ // ********** private function prototypes ********** -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 ); @@ -112,7 +111,7 @@ * The initFans function initializes the fans module. * @details Inputs: none * @details Outputs: fansExecState, fansControlCounter, fansPublishCounter, - * isPOSTComplete, hasAlarmBeenRaised, rpmAlarmStartTime, + * hasAlarmBeenRaised, rpmAlarmStartTime, * fansStatus, rpmAlarmStartTimeOffset * @return none *************************************************************************/ @@ -121,10 +120,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; @@ -160,8 +158,6 @@ BOOL calStatus = getNVRecord2Driver( GET_CAL_FANS_RECORD, (U08*)&fansCalReocrd, sizeof( DG_FANS_CAL_RECORD_T ), NUM_OF_CAL_DATA_FANS, ALARM_ID_NO_ALARM ); - // Signal POST is completed - isPOSTComplete = TRUE; if ( TRUE == calStatus ) { @@ -186,8 +182,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: @@ -248,18 +244,13 @@ * @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 ); - setOutletFansDutyCycle( 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 ); + setOutletFansDutyCycle( FANS_MIN_DUTY_CYCLE ); return state; }