Index: firmware/App/Controllers/BloodLeak.c =================================================================== diff -u -rfae38745527912b9b64e618096556ae7ff263cb8 -r100c3f3ae29e9956c399dfec2479fcffc2a330ec --- firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision fae38745527912b9b64e618096556ae7ff263cb8) +++ firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision 100c3f3ae29e9956c399dfec2479fcffc2a330ec) @@ -1852,6 +1852,14 @@ *************************************************************************/ static BOOL isLowerRangeIntensityDriftZeroingNeeded( void ) { + /* + * Nominal intensity = 930 + * Set point is queried from the blood leak detector + * Min drift from top = 930 - (setpoint * 40%) + * Max drift from top = 930 - (setpoint * 35%) + * If Min drift from top ≤ moving average intensity ≤ Max drift from top then the debounce timer is set + * If the debounce time has been elapsed the signal to zero the BLD is set + */ BOOL status = FALSE; BOOL isZeroingNeeded = TRUE; U32 setPoint = bloodLeakEmbModeCmd[ D_EMB_MODE_CMD ].commandResp; @@ -1866,11 +1874,13 @@ if ( FALSE == isZeroingNeeded ) { + // Intensity drift is not in range so reset the debounce timer bloodLeakZeroingStatus.driftInRangeStartTimeMS = getMSTimerCount(); } if ( ( TRUE == isZeroingAllowed ) && ( TRUE == didTimeout( bloodLeakZeroingStatus.driftInRangeStartTimeMS, BLD_ZERO_IN_RANGE_DRIFT_TIMEOUT_MS ) ) ) { + // If the moving average intensity is set and then the debounce time has elapsed the signal to zero is set to true. status = TRUE; } Index: firmware/App/Modes/Dialysis.c =================================================================== diff -u -rfae38745527912b9b64e618096556ae7ff263cb8 -r100c3f3ae29e9956c399dfec2479fcffc2a330ec --- firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision fae38745527912b9b64e618096556ae7ff263cb8) +++ firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 100c3f3ae29e9956c399dfec2479fcffc2a330ec) @@ -1159,9 +1159,8 @@ if ( TRUE == bloodLeakZeroingStatus.isZeroingRequestedFromTreatmentStop ) { - // Cmd all pumps to stop + // Cmd DPo to stop setDialOutPumpTargetRate( 0, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); - stopSyringePump(); setValvePosition( VDI, VALVE_POSITION_C_CLOSE ); setValvePosition( VDO, VALVE_POSITION_C_CLOSE ); Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -r4b38a0f0c305786a6dadec8b6939af811e77f540 -r100c3f3ae29e9956c399dfec2479fcffc2a330ec --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 4b38a0f0c305786a6dadec8b6939af811e77f540) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 100c3f3ae29e9956c399dfec2479fcffc2a330ec) @@ -795,14 +795,15 @@ case DIALYSIS_UF_STATE: treatmentTimeMS += msSinceLast; break; + case DIALYSIS_BLOOD_LEAK_ZEROING_STATE: if ( BLD_ZEROING_FLUSH_RSRVR_2_DPI_STATE == getBloodLeakZeroingState() ) { treatmentTimeMS += msSinceLast; } - default: case DIALYSIS_SALINE_BOLUS_STATE: + default: // Do not accumulate treatment time break; }