Index: firmware/App/Controllers/Fans.c =================================================================== diff -u -r31aa23b12f37b9d16b5160369ccb7dab6c6eca4d -r8defcfa32034c4068b733930c2e8b0989c55daba --- firmware/App/Controllers/Fans.c (.../Fans.c) (revision 31aa23b12f37b9d16b5160369ccb7dab6c6eca4d) +++ firmware/App/Controllers/Fans.c (.../Fans.c) (revision 8defcfa32034c4068b733930c2e8b0989c55daba) @@ -20,6 +20,7 @@ #include "Fans.h" #include "FPGA.h" #include "MessageSupport.h" +#include "NVDataMgmt.h" #include "PersistentAlarm.h" #include "SystemCommMessages.h" #include "TaskGeneral.h" @@ -81,6 +82,7 @@ static BOOL hasAlarmBeenRaised = FALSE; ///< Flag that indicates whether the RPM out of range alarm been raise. 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. +static DG_FANS_CAL_RECORD_T fansCalReocrd; ///< Fans calibration record. /// 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 ); @@ -148,20 +150,28 @@ * @brief * The execFansSelfTest function executes the fans self test. * @details Inputs: none - * @details Outputs: isPOSTComplete + * @details Outputs: isPOSTComplete, fansCalReocrd * @return Status of self test *************************************************************************/ SELF_TEST_STATUS_T execFansSelfTest( void ) { - SELF_TEST_STATUS_T status = SELF_TEST_STATUS_IN_PROGRESS; + SELF_TEST_STATUS_T result = SELF_TEST_STATUS_IN_PROGRESS; - // TODO implement the calibration processing function. - // It returns a pass for now - + 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; - status = SELF_TEST_STATUS_PASSED; - return status; + if ( TRUE == calStatus ) + { + result = SELF_TEST_STATUS_PASSED; + } + else + { + result = SELF_TEST_STATUS_FAILED; + } + + return result; } /*********************************************************************//**