Index: firmware/App/Controllers/Thermistors.c =================================================================== diff -u -rb3577735183df5556cc0042f87247685af45fa95 -r71013d049b8315a9aba65e4f7544a5168aeca109 --- firmware/App/Controllers/Thermistors.c (.../Thermistors.c) (revision b3577735183df5556cc0042f87247685af45fa95) +++ firmware/App/Controllers/Thermistors.c (.../Thermistors.c) (revision 71013d049b8315a9aba65e4f7544a5168aeca109) @@ -86,6 +86,7 @@ static void convertADC2Temperature( void ); static F32 calculateThermistorTemperature( THERMISTORS_TEMP_SENSORS_T thermistor, U32 adcValue ); static void publishThermistorsData( void ); +static void adjustThermistorSensorsRefResistance( void ); /*********************************************************************//** * @brief @@ -97,28 +98,6 @@ void initThermistors( void ) { - // Set voltage reference and ADC bit resolution for each thermistor -#ifndef _RELEASE_ - if ( HW_CONFIG_BETA == getHardwareConfigStatus() ) - { - thermistorsStatus[ THERMISTOR_ONBOARD_NTC ].voltageReference = THERMISTOR_REFERENCE_VOLTAGE; - thermistorsStatus[ THERMISTOR_ONBOARD_NTC ].adcBitResolution = TWELVE_BIT_RESOLUTION; - thermistorsStatus[ THERMISTOR_POWER_SUPPLY_1 ].voltageReference = THERMISTOR_REFERENCE_VOLTAGE; - thermistorsStatus[ THERMISTOR_POWER_SUPPLY_1 ].adcBitResolution = TWELVE_BIT_RESOLUTION; - thermistorsStatus[ THERMISTOR_POWER_SUPPLY_2 ].voltageReference = THERMISTOR_FPGA_REF_VOLTAGE; - thermistorsStatus[ THERMISTOR_POWER_SUPPLY_2 ].adcBitResolution = TWELVE_BIT_RESOLUTION; - } - else -#endif - { - thermistorsStatus[ THERMISTOR_ONBOARD_NTC ].voltageReference = THERMISTOR_FPGA_REF_VOLTAGE; - thermistorsStatus[ THERMISTOR_ONBOARD_NTC ].adcBitResolution = TEN_BIT_RESOLUTION; - thermistorsStatus[ THERMISTOR_POWER_SUPPLY_1 ].voltageReference = THERMISTOR_REFERENCE_VOLTAGE; - thermistorsStatus[ THERMISTOR_POWER_SUPPLY_1 ].adcBitResolution = TWELVE_BIT_RESOLUTION; - thermistorsStatus[ THERMISTOR_POWER_SUPPLY_2 ].voltageReference = THERMISTOR_FPGA_REF_VOLTAGE; - thermistorsStatus[ THERMISTOR_POWER_SUPPLY_2 ].adcBitResolution = TEN_BIT_RESOLUTION; - } - // Reset the thermistors values for a run thermistorsExecState = THERMISTORS_EXEC_STATE_START_STATE; dataPublishCounter = DATA_PUBLISH_COUNTER_START_COUNT; @@ -153,6 +132,10 @@ *************************************************************************/ void execThermistors( void ) { + + // Adjust thermistors based upon hardware configuration + adjustThermistorSensorsRefResistance(); + switch ( thermistorsExecState ) { case THERMISTORS_EXEC_STATE_START_STATE: @@ -465,14 +448,9 @@ if ( ( thermistor < NUM_OF_THERMISTORS ) && ( TRUE == isTestingActivated() ) ) { - // There is a temperature range that the thermistors can be set to, otherwise, the driver - // will throw an alarm. Also, the fans driver depends on these values to continuously control the fans - if ( ( temperature >= MIN_ALLOWED_TEMPERATURE ) && ( temperature < MAX_ALLOWED_TEMPERATURE ) ) - { - result = TRUE; - thermistorsStatus[ thermistor ].temperatureValue.ovData = temperature; - thermistorsStatus[ thermistor ].temperatureValue.override = OVERRIDE_KEY; - } + result = TRUE; + thermistorsStatus[ thermistor ].temperatureValue.ovData = temperature; + thermistorsStatus[ thermistor ].temperatureValue.override = OVERRIDE_KEY; } return result; @@ -504,4 +482,38 @@ return result; } +/*********************************************************************//** + * @brief + * The adjustTemperatureSensorsRefResistance function adjusts the temperature + * sensors V3 or DVT reference resistance values. + * @details Inputs: tempSensors + * @details Outputs: tempSensors + * @return none + *************************************************************************/ +static void adjustThermistorSensorsRefResistance( void ) +{ + + // Set voltage reference and ADC bit resolution for each thermistor +#ifndef _RELEASE_ + if ( HW_CONFIG_BETA == getHardwareConfigStatus() ) + { + thermistorsStatus[ THERMISTOR_ONBOARD_NTC ].voltageReference = THERMISTOR_REFERENCE_VOLTAGE; + thermistorsStatus[ THERMISTOR_ONBOARD_NTC ].adcBitResolution = TWELVE_BIT_RESOLUTION; + thermistorsStatus[ THERMISTOR_POWER_SUPPLY_1 ].voltageReference = THERMISTOR_REFERENCE_VOLTAGE; + thermistorsStatus[ THERMISTOR_POWER_SUPPLY_1 ].adcBitResolution = TWELVE_BIT_RESOLUTION; + thermistorsStatus[ THERMISTOR_POWER_SUPPLY_2 ].voltageReference = THERMISTOR_FPGA_REF_VOLTAGE; + thermistorsStatus[ THERMISTOR_POWER_SUPPLY_2 ].adcBitResolution = TWELVE_BIT_RESOLUTION; + } + else +#endif + { + thermistorsStatus[ THERMISTOR_ONBOARD_NTC ].voltageReference = THERMISTOR_FPGA_REF_VOLTAGE; + thermistorsStatus[ THERMISTOR_ONBOARD_NTC ].adcBitResolution = TEN_BIT_RESOLUTION; + thermistorsStatus[ THERMISTOR_POWER_SUPPLY_1 ].voltageReference = THERMISTOR_REFERENCE_VOLTAGE; + thermistorsStatus[ THERMISTOR_POWER_SUPPLY_1 ].adcBitResolution = TWELVE_BIT_RESOLUTION; + thermistorsStatus[ THERMISTOR_POWER_SUPPLY_2 ].voltageReference = THERMISTOR_FPGA_REF_VOLTAGE; + thermistorsStatus[ THERMISTOR_POWER_SUPPLY_2 ].adcBitResolution = TEN_BIT_RESOLUTION; + } +} + /**@}*/