Index: firmware/App/Services/Reservoirs.c =================================================================== diff -u -r9cc5da6947aa143a10f95519eb7f366c1b095d61 -r5e3a46112ebab361a33b9f7cadb619eb12b44c0f --- firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 9cc5da6947aa143a10f95519eb7f366c1b095d61) +++ firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 5e3a46112ebab361a33b9f7cadb619eb12b44c0f) @@ -19,6 +19,7 @@ #include "ConcentratePumps.h" #include "DrainPump.h" +#include "FPGA.h" #include "Heaters.h" #include "LoadCell.h" #include "MessageSupport.h" @@ -179,12 +180,6 @@ } } - if ( ( FALSE == nvOps.hasDisStatusBeenWrittenToNV ) && ( MODE_TREA == hdModes.hdMode ) ) - { - // If the disinfect status has not been set and we are in treatment mode, void the disinfect (chemical or heat disinfects) - nvOps.hasDisStatusBeenWrittenToNV = setDisinfectStatus( FALSE ); - } - // publish active reservoir, fill/drain volume targets at 1 Hz. if ( ++dataPublishCounter >= RESERVOIR_DATA_PUB_INTERVAL ) { @@ -686,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; @@ -818,8 +824,7 @@ *************************************************************************/ BOOL hasTargetDrainVolumeBeenReached( DG_RESERVOIR_ID_T reservoirId, U32 timeout ) { - BOOL result = FALSE; - + BOOL result = FALSE; F32 loadcellWeightML = getLoadCellSmallFilteredWeight( associatedLoadCell[ reservoirId ] ); U32 drainPumpFeedbackRPM = getDrainPumpMeasuredRPM();