Index: firmware/App/Controllers/Thermistors.c =================================================================== diff -u -rddb9707d9e6e46c4b384782aeec20d41f3822996 -r22f1a58ac8e419353ec004b04e7c765c1d59df2b --- firmware/App/Controllers/Thermistors.c (.../Thermistors.c) (revision ddb9707d9e6e46c4b384782aeec20d41f3822996) +++ firmware/App/Controllers/Thermistors.c (.../Thermistors.c) (revision 22f1a58ac8e419353ec004b04e7c765c1d59df2b) @@ -126,6 +126,15 @@ break; } + // First convert the values + convertADC2Temperature(); + + // Monitor the values for a gross range check + // Monitor is called in this function because this driver is constantly reading + // the thermistor values. Also the internal ADC values are processed with moving average in the internalADC driver + // So the thermistors drivers just gets the latest ADC value and converts it to temperature + monitorThermistors(); + // Check if it is time to publish any data publishThermistorsData(); } @@ -205,12 +214,6 @@ thermistorsStatus[ THERMISTOR_POWER_SUPPLY_1 ].rawADCRead = getIntADCReading( INT_ADC_POWER_SUPPLY_1_THERMISTOR ); thermistorsStatus[ THERMISTOR_POWER_SUPPLY_2 ].rawADCRead = getIntADCReading( INT_ADC_POWER_SUPPLY_2_THERMISTOR ); - // Monitor the values for a gross range check - // Monitor is called in this function because this driver is constantly reading - // the thermistor values. Also the internal ADC values are processed with moving average in the internalADC driver - // So the thermistors drivers just gets the latest ADC value and converts it to temperature - monitorThermistors(); - // Zero the counter for the next round of reading adcReadCounter = 0; } @@ -231,13 +234,10 @@ THERMISTORS_TEMP_SENSORS_T thermistor; F32 temperature; - // First convert the values - convertADC2Temperature(); - for ( thermistor = THERMISTOR_ONBOARD_NTC; thermistor < NUM_OF_THERMISTORS; thermistor++ ) { temperature = getThermistorTemperatureValue( thermistor ); - BOOL const isTempOutOfRange = ( temperature > MAX_ALLOWED_TEMPERATURE ) || ( temperature < MIN_ALLOWED_TEMPERATURE ); + BOOL isTempOutOfRange = ( temperature > MAX_ALLOWED_TEMPERATURE ) || ( temperature < MIN_ALLOWED_TEMPERATURE ); checkPersistentAlarm( ALARM_ID_DG_THERMISTORS_TEMPERATURE_OUT_OF_RANGE, isTempOutOfRange, temperature, MAX_ALLOWED_TEMPERATURE ); }