/************************************************************************** * * Copyright (c) 2019-2021 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file Fans.c * * @author (last) Sean Nash * @date (last) 12-Nov-2021 * * @author (original) Dara Navaei * @date (original) 04-Aug-2021 * ***************************************************************************/ #include "etpwm.h" #include "Fans.h" #include "FPGA.h" #include "PersistentAlarm.h" #include "SystemCommMessages.h" #include "TaskGeneral.h" #include "Temperatures.h" #include "Timers.h" /** * @addtogroup Fans * @{ */ // ********** private definitions ********** #define FANS_MIN_DUTY_CYCLE 0.1 ///< Fans min PWM. #define FANS_MAX_DUTY_CYCLE 0.95 ///< Fans max PWM. #define MIN_ALLOWED_AMBIENT_TEMPERATURE 20 ///< Min allowed ambient temperature. #define MAX_ALLOWED_AMBINET_TEMPERATURE 70 ///< Max allowed ambient temperature. #define FANS_MAX_ALLOWED_RAMP_UP_DELTA_DUTY_CYCLE 0.3 ///< Fans max allowed ramp up PWM change. #define FANS_MAX_ALLOWED_RAMP_DOWN_DELTA_DUTY_CYCLE 0.005 ///< Fans min allowed ramp down PWM change. #define TOGGLE_PERIOD_RESOLUTION_SECONDS 0.0000025 ///< FPGA fans toggle period resolution in micro seconds. #define ROTATIONAL_TO_TOGGLE_PERIOD_CONVERSION 4 ///< FPGA rotational to toggle period conversion coefficient. #define FANS_DATA_PUBLISH_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Fans publish data time interval in counts. #define FANS_CONTROL_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Fans control time interval in counts. #define FANS_ZERO_RPM_TOGGLE_PERIOD_VALUE 0xFFFF ///< Fans zero RPM toggle period value. #define MIN_TARGET_RPM_IN_SELF_TEST 1000 ///< Fans min target RPM that they should be during POST. #define FANS_SELF_TEST_WAIT_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Fans self test wait time for the fans to get to RPM. #define FANS_SELF_TEST_TARGET_PWM 0.5 ///< Fans self test target PWM for testing the fans are running. #define FANS_MAX_ALLOWED_RPM_OUT_OF_RANGE_INTERVAL ( 3 * MS_PER_SECOND ) ///< Fans max allowed RPM out of range time interval. #define FANS_MAX_ALLOWED_RPM 5500 ///< Fans max allowed RPM value. #define FANS_MIN_ALLOWED_RPM 150 ///< Fans max allowed RPM value. #define FANS_MONITOR_INTERVAL_COUNT ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Fans monitor time interval in counts. #define FANS_MIN_RPM_OUT_OF_RANGE_TOL 0.25 ///< Fans min RPM out of range tolerance. #define FANS_MAX_RPM_OUT_OF_RANGE_TOL 0.5 ///< Fans max RPM out of range tolerance. /// Fans exec states typedef enum fans_Exec_States { FANS_EXEC_STATE_WAIT_FOR_POST_STATE = 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; /// Fans status struct typedef struct { F32 targetDutyCycle; ///< Fan's target duty cycle that was fed to the fans F32 targetRPM; ///< Fan's target RPM OVERRIDE_F32_T rpm[ NUM_OF_FANS_NAMES ]; ///< Fan's current tachometers reading in RPM } FAN_STATUS_T; 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 U32 fansPublishCounter = 0; ///< Fans data publish interval counter. static U32 fansMonitorCounter = 0; ///< Fans monitor interval counter. static BOOL isPOSTComplete = FALSE; ///< Flag that indicates whether POST is complete or not. static BOOL hasAlarmBeenRaised = FALSE; ///< Flag that indicates whether RPM out of range alarm has been raised once. static OVERRIDE_U32_T rpmAlarmStartTimeOffset = { 0, 0, 0, 0}; ///< RPM out of range alarm start time offset. static U32 rpmAlarmStartTime = 0; ///< RPM alarm start time. /// Temperature to duty cycle conversion slope (duty cycle not in percent) static const F32 SLOPE = ( FANS_MAX_DUTY_CYCLE - FANS_MIN_DUTY_CYCLE ) / ( MAX_ALLOWED_AMBINET_TEMPERATURE - MIN_ALLOWED_AMBIENT_TEMPERATURE ); /// FGPA Toggle to RPM conversion coefficient static const F32 TOGGLE_PERIOD_2_RPM_COEFFICIENT = SEC_PER_MIN / ( TOGGLE_PERIOD_RESOLUTION_SECONDS * ROTATIONAL_TO_TOGGLE_PERIOD_CONVERSION ); 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 handleExecStateRun( void ); static void setInletFansDutyCycle( F32 pwm ); static F32 getMaximumTemperature( void ); static void convertTogglePeriod2RPM( void ); static void monitorFans( void ); static U32 getPublishFansDataInterval( void ); static U32 getRPMAlarmStartTimeOffset( void ); static void publishFansData( void ); /*********************************************************************//** * @brief * The initFans function initializes the fans module. * @details Inputs: none * @details Outputs: fansExecState, fansMonitorCounter, fansControlCounter, * fansPublishCounter, isPOSTComplete, hasAlarmBeenRaised, fansStatus, * rpmAlarmStartTimer * @return none *************************************************************************/ void initFans( void ) { FAN_NAMES_T fan; // Initialize the variables fansExecState = FANS_EXEC_STATE_WAIT_FOR_POST_STATE; fansControlCounter = 0; fansPublishCounter = 0; fansMonitorCounter = 0; isPOSTComplete = FALSE; hasAlarmBeenRaised = FALSE; rpmAlarmStartTime = 0; rpmAlarmStartTimeOffset.data = 0; rpmAlarmStartTimeOffset.ovData = 0; rpmAlarmStartTimeOffset.ovInitData = 0; rpmAlarmStartTimeOffset.override = 0; // Initialize the fans for ( fan = FAN_INLET_1; fan < NUM_OF_FANS_NAMES; fan++ ) { fansStatus.targetDutyCycle = 0.0; fansStatus.targetRPM = 0.0; fansStatus.rpm[ fan ].data = 0.0; fansStatus.rpm[ fan ].ovData = 0.0; fansStatus.rpm[ fan ].ovInitData = 0.0; fansStatus.rpm[ fan ].override = OVERRIDE_RESET; } // Initialize a persistent alarm for fans RPM out of range initPersistentAlarm( ALARM_ID_HD_FAN_RPM_OUT_OF_RANGE, FANS_MAX_ALLOWED_RPM_OUT_OF_RANGE_INTERVAL, FANS_MAX_ALLOWED_RPM_OUT_OF_RANGE_INTERVAL ); } /*********************************************************************//** * @brief * The execFansSelfTest function executes the fans self test. * @details Inputs: none * @details Outputs: isPOSTComplete * @return Status of self test *************************************************************************/ SELF_TEST_STATUS_T execFansSelfTest( void ) { SELF_TEST_STATUS_T status = SELF_TEST_STATUS_IN_PROGRESS; // TODO implement the calibration processing function. // It returns a pass for now isPOSTComplete = TRUE; status = SELF_TEST_STATUS_PASSED; return status; } /*********************************************************************//** * @brief * The execFans function executes the execFans exec states. * @details Inputs: fansExecState * @details Outputs: fansExecState * @return none *************************************************************************/ void execFans( void ) { switch ( fansExecState ) { case FANS_EXEC_STATE_WAIT_FOR_POST_STATE: fansExecState = handleExecStateWaitForPOST(); break; case FANS_EXEC_STATE_RUN_STATE: fansExecState = handleExecStateRun(); break; default: SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_HD_FANS_INVALID_STATE, fansExecState ); fansExecState = FANS_EXEC_STATE_RUN_STATE; break; } // Convert the counts to RPM convertTogglePeriod2RPM(); // Monitor the RPM of the fans monitorFans(); // Check for the publication time publishFansData(); } /*********************************************************************//** * @brief * The getFanRPM function returns the RPM a the selected fan. * @details Inputs: fansStatus * @details Outputs: none * @param selected fan to read its RPM * @return RPM of the selected fan *************************************************************************/ F32 getMeasuredFanRPM( FAN_NAMES_T fan ) { F32 rpm; // Check if the called fan is in range if ( fan < NUM_OF_FANS_NAMES ) { // Assume there is no override rpm = fansStatus.rpm[ fan ].data; if ( OVERRIDE_KEY == fansStatus.rpm[ fan ].override ) { rpm = fansStatus.rpm[ fan ].ovData; } } else { SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_HD_INVALID_FAN_SELECTED, fan ); } return rpm; } /*********************************************************************//** * @brief * The handleFansExecStateStart function handles the start state of the * fans exec state machine. * @details Inputs: none * @details Outputs: none * @return the next state of the exec state machine *************************************************************************/ static FANS_EXEC_STATES_T handleExecStateWaitForPOST( void ) { FANS_EXEC_STATES_T state = FANS_EXEC_STATE_WAIT_FOR_POST_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; } #ifndef _VECTORCAST_ // To skip the wait for POST and start running. // TODO REMOVE state = FANS_EXEC_STATE_RUN_STATE; // TODO REMOVE #endif return state; } /*********************************************************************//** * @brief * The handleFansExecStateRun function handles the run state of the * fans exec state machine. * @details Inputs: fansStatus, fansControlCounter * @details Outputs: fansStatus, fansControlCounter * @return the next state of the exec state machine *************************************************************************/ static FANS_EXEC_STATES_T handleExecStateRun( void ) { FANS_EXEC_STATES_T state = FANS_EXEC_STATE_RUN_STATE; // Check if it is time to check for the control if ( ++fansControlCounter > FANS_CONTROL_INTERVAL ) { // Get the maximum temperature among all the thermistors and temperature sensors to run fan from the hottest temperature F32 temperature = getMaximumTemperature(); // Solve the linear equation to calculate the duty cycle from temperature F32 dutyCycle = ( SLOPE * ( temperature - MIN_ALLOWED_AMBIENT_TEMPERATURE ) ) + FANS_MIN_DUTY_CYCLE; // Check whether the duty cycle is not outside of the range and cap it if needed if ( dutyCycle < FANS_MIN_DUTY_CYCLE ) { dutyCycle = FANS_MIN_DUTY_CYCLE; } if ( dutyCycle > FANS_MAX_DUTY_CYCLE ) { dutyCycle = FANS_MAX_DUTY_CYCLE; } // If the fans calculated duty cycle is greater than the previous calculated duty cycle, we are ramping up // otherwise, we are ramping down if ( dutyCycle >= fansStatus.targetDutyCycle ) { // If the delta duty cycle from the previous duty cycle is greater than the max allowed ramp up duty cycle, // otherwise, only add the delta duty cycle if ( ( dutyCycle - fansStatus.targetDutyCycle ) >= FANS_MAX_ALLOWED_RAMP_UP_DELTA_DUTY_CYCLE ) { fansStatus.targetDutyCycle += FANS_MAX_ALLOWED_RAMP_UP_DELTA_DUTY_CYCLE; } else { fansStatus.targetDutyCycle = dutyCycle; } } else { // If the delta duty cycle from the previous duty cycle is greater than the max allowed ramp down duty cycle, // otherwise, only add the delta duty cycle if ( ( fansStatus.targetDutyCycle - dutyCycle ) >= FANS_MAX_ALLOWED_RAMP_DOWN_DELTA_DUTY_CYCLE ) { // If we are ramping down, set the target duty cycle to max allowed ramp down duty cycle fansStatus.targetDutyCycle -= FANS_MAX_ALLOWED_RAMP_DOWN_DELTA_DUTY_CYCLE; } else { fansStatus.targetDutyCycle = dutyCycle; } } // Calculate the target RPM from the duty cycle. fansStatus.targetRPM = fansStatus.targetDutyCycle * FANS_MAX_ALLOWED_RPM; // Set the PWM to inlet and outlet fans setInletFansDutyCycle( fansStatus.targetDutyCycle ); // Reset the counter fansControlCounter = 0; } return state; } /*********************************************************************//** * @brief * The setInletFansPWM function sets the inlet fans PWM. * @details Inputs: none * @details Outputs: none * @param PWM that will be set * @return none *************************************************************************/ static void setInletFansDutyCycle( F32 pwm ) { etpwmSetCmpA( etpwmREG7, (U32)( (S32)( ( pwm * (F32)(etpwmREG6->TBPRD) ) + FLOAT_TO_INT_ROUNDUP_OFFSET ) ) ); } /*********************************************************************//** * @brief * The getMaximumTemperature function gets the maximum temperature on the boards. * @details Inputs: none * @details Outputs: none * @return maximum temperature of the thermistors and temperature sensors ************************************************************************/ static F32 getMaximumTemperature( void ) { F32 temperature; F32 maxTemperature = 0.0; // NOTE: A for loop was not used because the venous pressure sensor's temperature // is not used as one of temperature values to decide the hottest temperature temperature = getTemperatureValue( THERMISTOR_ONBOARD_NTC ); maxTemperature = ( temperature > maxTemperature ? temperature : maxTemperature ); temperature = getTemperatureValue( THERMISTOR_POWER_SUPPLY_1 ); maxTemperature = ( temperature > maxTemperature ? temperature : maxTemperature ); temperature = getTemperatureValue( TEMPSENSOR_FPGA_BOARD_SENSOR ); maxTemperature = ( temperature > maxTemperature ? temperature : maxTemperature ); temperature = getTemperatureValue( TEMPSENSOR_PBA_ADC_SENSOR ); maxTemperature = ( temperature > maxTemperature ? temperature : maxTemperature ); return maxTemperature; } /*********************************************************************//** * @brief * The convertTogglePeriod2RPM function runs through the list of the fans * to get the FPGA pulse from them and converts them to RPM. * @details Inputs: fansStatus, toggle2RPMCoefficient * @details Outputs: fansStatus * @return none ************************************************************************/ static void convertTogglePeriod2RPM( void ) { FAN_NAMES_T fan; U32 togglePeriods[ NUM_OF_FANS_NAMES ]; togglePeriods[ FAN_INLET_1 ] = getFPGAInletFan1TogglePeriod(); for ( fan = FAN_INLET_1; fan < NUM_OF_FANS_NAMES; fan++ ) { // If the pulse is close to 0 or 0, FPGA will report 0xFFFF // Otherwise, convert the pulse to RPM if ( FANS_ZERO_RPM_TOGGLE_PERIOD_VALUE == togglePeriods[ fan ] ) { fansStatus.rpm[ fan ].data = 0; } else { // Convert toggle period to RPM fansStatus.rpm[ fan ].data = TOGGLE_PERIOD_2_RPM_COEFFICIENT / togglePeriods[ fan ]; } } } /*********************************************************************//** * @brief * The monitorFans function monitors the fans for RPM. * @details Inputs: fansMonitorCounter, rpmAlarmStartTimer, hasAlarmBeenRaised * @details Outputs: fansMonitorCounter, hasAlarmBeenRaised, rpmAlarmStartTimer * @return none *************************************************************************/ static void monitorFans( void ) { if ( ++fansMonitorCounter >= FANS_MONITOR_INTERVAL_COUNT ) { FAN_NAMES_T fan; BOOL isFanRPMOutOfRange = FALSE; BOOL isAlarmTriggered = FALSE; F32 rpm = 0.0; // The RPM is expected to be 5500 @ 100% duty cycle // The nominal RPM = duty cycle * 5500 / 1.0 // The RPM tolerance is -25% to +50% of the nominal RPM F32 fansNominalRPM = fansStatus.targetDutyCycle * FANS_MAX_ALLOWED_RPM; F32 fansMinAllowedRPM = fansNominalRPM - ( fansNominalRPM * FANS_MIN_RPM_OUT_OF_RANGE_TOL ); F32 fansMaxAllowedRPM = fansNominalRPM + ( fansNominalRPM * FANS_MAX_RPM_OUT_OF_RANGE_TOL ); // Loop through the fans and make sure the each of them have RPM in range for ( fan = FAN_INLET_1; fan < NUM_OF_FANS_NAMES; fan++ ) { rpm = getMeasuredFanRPM( fan ); isFanRPMOutOfRange |= ( ( rpm < fansMinAllowedRPM ) || ( rpm > fansMaxAllowedRPM ) ? TRUE : FALSE ); } if ( FALSE == hasAlarmBeenRaised ) { isAlarmTriggered = isPersistentAlarmTriggered( ALARM_ID_HD_FAN_RPM_OUT_OF_RANGE, isFanRPMOutOfRange ); if ( TRUE == isAlarmTriggered ) { SET_ALARM_WITH_1_F32_DATA( ALARM_ID_HD_FAN_RPM_OUT_OF_RANGE, rpm ) // Set the alarm flag to TRUE hasAlarmBeenRaised = TRUE; } // If the alarm has been raised but the start time of the alarm has not been set, set the alarm start timer if ( ( TRUE == hasAlarmBeenRaised ) && ( 0 == rpmAlarmStartTime ) ) { rpmAlarmStartTime = getMSTimerCount(); } } // If the alarm has been raised and the alarm has been silent for at least a day, set the flag to FALSE // This way, if the fans RPM are out of range the alarm will be raised again. This alarm is supposed to be raised // and remain silent for a defined period of time. else if ( ( TRUE == hasAlarmBeenRaised ) && ( ( calcTimeSince( rpmAlarmStartTime ) + getRPMAlarmStartTimeOffset() ) >= SECONDS_IN_A_DAY * MS_PER_SECOND ) ) { hasAlarmBeenRaised = FALSE; rpmAlarmStartTime = 0; } else { // If the alarm has been raised and 24 hours has not elapsed, check if the fans RPM is back in range again // If the fans RPM is in range again, clear the alarm if ( FALSE == isFanRPMOutOfRange ) { clearAlarmCondition( ALARM_ID_HD_FAN_RPM_OUT_OF_RANGE ); } } fansMonitorCounter = 0; } } /*********************************************************************//** * @brief * The getRPMAlarmStartTimeOffset function gets the RPM alarm start time offset in MS. * @details Inputs: rpmAlarmStartTimeOffset * @details Outputs: none * @return the RPM alarm start time offset *************************************************************************/ static U32 getRPMAlarmStartTimeOffset( void ) { U32 startTime = rpmAlarmStartTimeOffset.data; if ( OVERRIDE_KEY == rpmAlarmStartTimeOffset.override ) { startTime = rpmAlarmStartTimeOffset.ovData; } return startTime; } /*********************************************************************//** * @brief * The getPublishFansDataInterval function gets the fans data publish interval. * @details Inputs: fansPublishInterval * @details Outputs: none * @return data publish time interval in counts *************************************************************************/ static U32 getPublishFansDataInterval( void ) { U32 result = fansPublishInterval.data; if ( OVERRIDE_KEY == fansPublishInterval.override ) { result = fansPublishInterval.ovData; } return result; } /*********************************************************************//** * @brief * The publishFansData function publishes the fans data at the specified * time interval. * @details Inputs: dataPublishCounter * @details Outputs: dataPublishCounter * @return none *************************************************************************/ static void publishFansData( void ) { if ( ++fansPublishCounter > getPublishFansDataInterval() ) { FANS_DATA_T fansData; fansData.fansDutyCycle = fansStatus.targetDutyCycle * FRACTION_TO_PERCENT_FACTOR; fansData.fansTargetRPM = fansStatus.targetRPM; fansData.fanInlet1RPM = getMeasuredFanRPM( FAN_INLET_1 ); broadcastData( MSG_ID_HD_FANS_DATA, COMM_BUFFER_OUT_CAN_HD_BROADCAST, (U08*)&fansData, sizeof( FANS_DATA_T ) ); fansPublishCounter = 0; } } /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ /*********************************************************************//** * @brief * The testSetFanPublishIntervalOverride function overrides the fans data * publish interval. * @details Inputs: fansPublishInterval * @details Outputs: fansPublishInterval * @param value : override fans data publish interval with (in ms) * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testSetFanPublishIntervalOverride( U32 value ) { BOOL result = FALSE; if ( TRUE == isTestingActivated() ) { U32 intvl = value / TASK_GENERAL_INTERVAL; result = TRUE; fansPublishInterval.ovData = intvl; fansPublishInterval.override = OVERRIDE_KEY; } return result; } /*********************************************************************//** * @brief * The testResetFanPublishIntervalOverride function resets the override * of the fans data publish interval. * @details Inputs: fansPublishInterval * @details Outputs: fansPublishInterval * @return TRUE if override reset successful, FALSE if not ************************************************************************/ BOOL testResetFanPublishIntervalOverride( void ) { BOOL result = FALSE; if ( TRUE == isTestingActivated() ) { result = TRUE; fansPublishInterval.override = OVERRIDE_RESET; fansPublishInterval.ovData = fansPublishInterval.ovInitData; } return result; } /*********************************************************************//** * @brief * The testSetFanRPMOverride function overrides the RPM of a fan. * @details Inputs: none * @details Outputs: fansStatus * @param fanId fan ID * @param rpm the RPM override value * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testSetFanRPMOverride( U32 fanId, F32 rpm ) { BOOL result = FALSE; if ( fanId < NUM_OF_FANS_NAMES ) { if ( TRUE == isTestingActivated() ) { result = TRUE; fansStatus.rpm[ fanId ].ovData = rpm; fansStatus.rpm[ fanId ].override = OVERRIDE_KEY; } } return result; } /*********************************************************************//** * @brief * The testResetFanRPMOverride function resets the override value of a fan. * @details Inputs: none * @details Outputs: fansStatus * @param fanId fan index * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testResetFanRPMOverride( U32 fanId ) { BOOL result = FALSE; if ( fanId < NUM_OF_FANS_NAMES ) { if ( TRUE == isTestingActivated() ) { result = TRUE; fansStatus.rpm[ fanId ].ovData = fansStatus.rpm[ fanId ].ovInitData; fansStatus.rpm[ fanId ].override = OVERRIDE_RESET; } } return result; } /*********************************************************************//** * @brief * The testSetFanRPMAlarmStartTimeOffsetOverride function overrides the RPM alarm * start time offset. * @details Inputs: none * @details Outputs: rpmAlarmStartTimeOffset * @param hours hours to override * @param minutes minutes to override * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testSetFanRPMAlarmStartTimeOffsetOverride( U32 hours, U32 minutes ) { BOOL result = FALSE; if ( TRUE == isTestingActivated() ) { rpmAlarmStartTimeOffset.ovData = ( ( hours * MIN_PER_HOUR * SEC_PER_MIN ) + ( minutes * SEC_PER_MIN ) ) * MS_PER_SECOND; rpmAlarmStartTimeOffset.override = OVERRIDE_KEY; result = TRUE; } return result; } /*********************************************************************//** * @brief * The testResetFanRPMAlarmStartTimeOffsetOverride function resets the RPM alarm * start time offset override. * @details Inputs: none * @details Outputs: rpmAlarmStartTimeOffset * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testResetFanRPMAlarmStartTimeOffsetOverride( void ) { BOOL result = FALSE; if ( TRUE == isTestingActivated() ) { rpmAlarmStartTimeOffset.override = OVERRIDE_RESET; rpmAlarmStartTimeOffset.ovData = 0; rpmAlarmStartTimeOffset.data = 0; result = TRUE; } return result; } /**@}*/