Index: firmware/App/Services/Reservoirs.c =================================================================== diff -u -r1e34d32fcfac88792ed72e55953dee721bacd9d5 -r0b121a7c92a8d86f8369b7094b0bce21389f3747 --- firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 1e34d32fcfac88792ed72e55953dee721bacd9d5) +++ firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 0b121a7c92a8d86f8369b7094b0bce21389f3747) @@ -19,6 +19,7 @@ #include "ConcentratePumps.h" #include "DrainPump.h" +#include "FPGA.h" #include "Heaters.h" #include "LoadCell.h" #include "MessageSupport.h" @@ -680,11 +681,22 @@ if ( targetROFlowLPM > 0 ) { - F32 acidTemperature = acidConcentrateCalRecord.acidConcentrate[ CAL_DATA_ACID_CONCENTRATE_1 ].acidBottleTemperature; - F32 bicarbTemperature = bicarbConcentrateCalRecord.bicarbConcentrate[ CAL_DATA_BICARB_CONCENTRATE_1 ].bicarbBottleTemperature; - - priTargetTemp = ( tempTarget * ( tgtTotalFlowLPM / targetROFlowLPM ) ) - ( acidTemperature * ( tgtAicdFlowLPM / targetROFlowLPM ) ) - - ( bicarbTemperature * ( tgtBicarbFlowLPM / targetROFlowLPM ) ); +#ifndef _RELEASE_ + if ( ( HW_CONFIG_BETA == getHardwareConfigStatus() ) || + ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_USING_TPO_FOR_PRIMARY_HEATER_CONTROL ) ) ) + { + // In the later DVT units, TD2 is used for setting the primary heater target temperature. But in the older DVTs as well as the Beta units + // the target temperature is calculated by estimating the temperature of the dialysates and volume that is being mixed into the RO water + F32 acidTemperature = acidConcentrateCalRecord.acidConcentrate[ CAL_DATA_ACID_CONCENTRATE_1 ].acidBottleTemperature; + F32 bicarbTemperature = bicarbConcentrateCalRecord.bicarbConcentrate[ CAL_DATA_BICARB_CONCENTRATE_1 ].bicarbBottleTemperature; + priTargetTemp = ( tempTarget * ( tgtTotalFlowLPM / targetROFlowLPM ) ) - ( acidTemperature * ( tgtAicdFlowLPM / targetROFlowLPM ) ) - + ( bicarbTemperature * ( tgtBicarbFlowLPM / targetROFlowLPM ) ); + } + else +#endif + { + priTargetTemp = tempTarget; + } } return priTargetTemp;