Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -r8cf0fafa78ce14b5dbdf95510e957846660ac2b9 -rfb714597ad515d3774d69b94808f065788504724 --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 8cf0fafa78ce14b5dbdf95510e957846660ac2b9) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision fb714597ad515d3774d69b94808f065788504724) @@ -18,6 +18,7 @@ #include "AirTrap.h" #include "AlarmLamp.h" #include "BloodFlow.h" +#include "BloodLeak.h" #include "Buttons.h" #include "DGInterface.h" #include "DialInFlow.h" @@ -787,10 +788,24 @@ U32 msSinceLast = calcTimeBetween( lastTreatmentTimeStamp, newTime ); DIALYSIS_STATE_T dialysisState = getDialysisState(); - // Update treatment time (unless delivering a saline bolus) - if ( dialysisState != DIALYSIS_SALINE_BOLUS_STATE ) + // Update treatment time (unless delivering a saline bolus or is in blood leak zeroing state other than flush reservoir to DPi state) + switch ( dialysisState ) { - treatmentTimeMS += msSinceLast; + case DIALYSIS_START_STATE: + case DIALYSIS_UF_STATE: + treatmentTimeMS += msSinceLast; + break; + + case DIALYSIS_BLOOD_LEAK_ZEROING_STATE: + if ( BLD_ZEROING_FLUSH_RSRVR_2_DPI_STATE == getBloodLeakZeroingState() ) + { + treatmentTimeMS += msSinceLast; + } + + case DIALYSIS_SALINE_BOLUS_STATE: + default: + // Do not accumulate treatment time + break; } lastTreatmentTimeStamp = newTime; @@ -1495,6 +1510,7 @@ payload.txEndState = getCurrentTreatmentEndState(); payload.heparinState = getHeparinState(); payload.dialysisState = getDialysisState(); + payload.bloodLeakZeroingState = (U32)getBloodLeakZeroingState(); broadcastData( MSG_ID_TREATMENT_STATE_DATA, COMM_BUFFER_OUT_CAN_HD_BROADCAST, (U08*)&payload, sizeof( TREATMENT_STATE_DATA_T ) ); treatmentStateBroadcastTimerCtr = 0;