Index: firmware/App/Controllers/TemperatureSensors.c =================================================================== diff -u -rcd7ff5665a2ac5142e29c0cad5339af0639e7c57 -r417631131615f93f77d6d1bfe44c385a8eab6d5b --- firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision cd7ff5665a2ac5142e29c0cad5339af0639e7c57) +++ firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision 417631131615f93f77d6d1bfe44c385a8eab6d5b) @@ -7,8 +7,8 @@ * * @file TemperatureSensors.c * -* @author (last) Dara Navaei -* @date (last) 15-Mar-2023 +* @author (last) Bill Bracken +* @date (last) 28-Mar-2023 * * @author (original) Dara Navaei * @date (original) 08-Apr-2020 @@ -868,56 +868,51 @@ *************************************************************************/ static TEMPSENSORS_EXEC_STATES_T handleExecGetADCValues( void ) { - U32 errorCount = 0; U32 readCount = 0; - errorCount = (U32)getFPGARTDErrorCount(); readCount = (U32)getFPGARTDReadCount(); - checkFPGAPersistentAlarms( FPGA_PERS_ERROR_TWO_WIRE_ADC_TEMP_SENSORS, errorCount, readCount ); + checkFPGAPersistentAlarms( FPGA_PERS_ERROR_TWO_WIRE_ADC_TEMP_SENSORS, readCount ); processTempSnsrsADCRead( TEMPSENSORS_INLET_PRIMARY_HEATER, getFPGATPiTemp() ); processTempSnsrsADCRead( TEMPSENSORS_OUTLET_PRIMARY_HEATER, getFPGATPoTemp() ); processTempSnsrsADCRead( TEMPSENSORS_CONDUCTIVITY_SENSOR_1, getFPGACD1Temp() ); processTempSnsrsADCRead( TEMPSENSORS_CONDUCTIVITY_SENSOR_2, getFPGACD2Temp() ); processTempSnsrsADCRead( TEMPSENSORS_INTERNAL_COND_TEMP_SENSOR, getFPGACondSnsrInternalTemp() ); #ifndef _RELEASE_ - if ( getHardwareConfigStatus() != HW_CONFIG_BETA ) + if ( ( getHardwareConfigStatus() != HW_CONFIG_BETA ) && ( getCurrentOperationMode() != DG_MODE_INIT ) ) #endif { - if ( getCurrentOperationMode() != DG_MODE_INIT ) - { - errorCount = (U32)getFPGATHdErrorCount(); - readCount = (U32)getFPGATHdReadCount(); + readCount = (U32)getFPGATHdReadCount(); - checkFPGAPersistentAlarms( FPGA_PERS_ERROR_THD_ADC_TEMP_SENSORS, errorCount, readCount ); - processTempSnsrsADCRead( TEMPSENSORS_HEAT_DISINFECT, getFPGATHdTemp() ); - processTempSnsrsADCRead( TEMPSENSORS_INTERNAL_THD_RTD, getFPGATHdInternalTemp() ); + checkFPGAPersistentAlarms( FPGA_PERS_ERROR_THD_ADC_TEMP_SENSORS, readCount ); + processTempSnsrsADCRead( TEMPSENSORS_HEAT_DISINFECT, getFPGATHdTemp() ); - // Make sure the baro sensor coefficients are not corrupted - checkBaroSensorCRC(); + // Make sure the baro sensor coefficients are not corrupted + checkBaroSensorCRC(); - baroConvConsts.refTemperature = getFPGABaroReferenceTemperature(); - baroConvConsts.temperatureCoeff = getFPGABaroTempCoeffOfTemperature(); - errorCount = getFPGABaroErrorCount(); - readCount = getFPGABaroReadCount(); + processTempSnsrsADCRead( TEMPSENSORS_INTERNAL_THD_RTD, getFPGATHdInternalTemp() ); - checkFPGAPersistentAlarms( FPGA_PERS_ERROR_BARO_SENSOR, errorCount, readCount ); - processTempSnsrsADCRead( TEMPSENSORS_BAROMETRIC_TEMP_SENSOR, getFPGABaroTemperature() ); - } + // Make sure the baro sensor coefficients are not corrupted + checkBaroSensorCRC(); + + baroConvConsts.refTemperature = getFPGABaroReferenceTemperature(); + baroConvConsts.temperatureCoeff = getFPGABaroTempCoeffOfTemperature(); + readCount = getFPGABaroReadCount(); + + checkFPGAPersistentAlarms( FPGA_PERS_ERROR_BARO_SENSOR, readCount ); + processTempSnsrsADCRead( TEMPSENSORS_BAROMETRIC_TEMP_SENSOR, getFPGABaroTemperature() ); } - errorCount = (U32)getFPGATRoErrorCount(); readCount = (U32)getFPGATRoReadCount(); - checkFPGAPersistentAlarms( FPGA_PERS_ERROR_TRO_ADC_TEMP_SENSORS, errorCount, readCount ); + checkFPGAPersistentAlarms( FPGA_PERS_ERROR_TRO_ADC_TEMP_SENSORS, readCount ); processTempSnsrsADCRead( TEMPSENSORS_OUTLET_REDUNDANT, getFPGATRoTemp() ); processTempSnsrsADCRead( TEMPSENSORS_INTERNAL_TRO_RTD, getFPGATRoInternalTemp() ); - errorCount = (U32)getFPGATDiErrorCount(); readCount = (U32)getFPGATDiReadCount(); - checkFPGAPersistentAlarms( FPGA_PERS_ERROR_TDI_ADC_TEMP_SENSORS, errorCount, readCount ); + checkFPGAPersistentAlarms( FPGA_PERS_ERROR_TDI_ADC_TEMP_SENSORS, readCount ); processTempSnsrsADCRead( TEMPSENSORS_INLET_DIALYSATE, getFPGATDiTemp() ); processTempSnsrsADCRead( TEMPSENSORS_INTERNAL_TDI_RTD, getFPGATDiInternalTemp() );