Index: firmware/App/Controllers/SyringePump.c =================================================================== diff -u -r90ac1467b8d858ec3c690f50d87893f3b1778a33 -r722eb364d9b8d1fa9cc98da41f09c5fd73a8be39 --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 90ac1467b8d858ec3c690f50d87893f3b1778a33) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 722eb364d9b8d1fa9cc98da41f09c5fd73a8be39) @@ -994,6 +994,7 @@ syringePumpVolumeStartPosition = 0; syringePumpPositionKnown = TRUE; syringePumpVolumeDelivered.data = 0.0; + syringePumpSafetyVolumeDelivered = 0.0; syringePumpPlungerFound = FALSE; syringePumpPrimeCompleted = FALSE; result = SYRINGE_PUMP_OFF_STATE; @@ -1031,6 +1032,7 @@ stopPump = TRUE; syringePumpPlungerFound = TRUE; syringePumpVolumeDelivered.data = 0.0; + syringePumpSafetyVolumeDelivered = 0.0; syringePumpVolumeStartPosition = syringePumpPosition.data; } @@ -1072,6 +1074,7 @@ stopPump = TRUE; syringePumpPrimeCompleted = TRUE; syringePumpVolumeDelivered.data = 0.0; + syringePumpSafetyVolumeDelivered = 0.0; syringePumpVolumeStartPosition = syringePumpPosition.data; } @@ -1341,9 +1344,9 @@ { BOOL result = stopPump; F32 vol = getSyringePumpVolumeDelivered(); - F32 delta = fabs( vol - syringePumpSafetyVolumeDelivered ); F32 max = MAX( vol, syringePumpSafetyVolumeDelivered ); - F32 error = ( fabs( max ) < NEARLY_ZERO ? 0.0 : ( 1.0 - ( delta / max ) ) ); + F32 min = MIN( vol, syringePumpSafetyVolumeDelivered ); + F32 error = ( fabs( max ) < NEARLY_ZERO ? 0.0 : ( 1.0 - fabs( min / max ) ) ); if ( error > pctMargin ) { @@ -1462,6 +1465,7 @@ data.syringePumpState = (U32)syringePumpState; data.heparinDeliveryState = (U32)heparinDeliveryState; data.syringePumpVolumeDelivered = getSyringePumpVolumeDelivered(); + data.syringePumpSafetyVolume = syringePumpSafetyVolumeDelivered; broadcastSyringePumpData( data ); broadcastHeparinData( data.syringePumpVolumeDelivered ); Index: firmware/App/Controllers/SyringePump.h =================================================================== diff -u -r8b791e3252b79d693cb6d959648f85df2e44b709 -r722eb364d9b8d1fa9cc98da41f09c5fd73a8be39 --- firmware/App/Controllers/SyringePump.h (.../SyringePump.h) (revision 8b791e3252b79d693cb6d959648f85df2e44b709) +++ firmware/App/Controllers/SyringePump.h (.../SyringePump.h) (revision 722eb364d9b8d1fa9cc98da41f09c5fd73a8be39) @@ -64,6 +64,7 @@ F32 syringePumpMeasHome; F32 syringePumpMeasSwitch; F32 syringePumpMeasForce; + F32 syringePumpSafetyVolume; } SYRINGE_PUMP_DATA_PAYLOAD_T; // ********** public function prototypes ********** Index: firmware/App/Modes/Dialysis.c =================================================================== diff -u -r8b791e3252b79d693cb6d959648f85df2e44b709 -r722eb364d9b8d1fa9cc98da41f09c5fd73a8be39 --- firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 8b791e3252b79d693cb6d959648f85df2e44b709) +++ firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 722eb364d9b8d1fa9cc98da41f09c5fd73a8be39) @@ -609,6 +609,11 @@ stopSyringePump(); setHeparinCompleted(); } + // TODO - find a better way to start continuous delivery after bolus completes + if ( HEPARIN_STATE_STOPPED == getHeparinState() ) + { + startHeparinPump(); + } // Handle current ultrafiltration state switch ( currentUFState ) Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -rbb80dbac26147ab08413efa91007f7ffed43c38f -r722eb364d9b8d1fa9cc98da41f09c5fd73a8be39 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision bb80dbac26147ab08413efa91007f7ffed43c38f) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 722eb364d9b8d1fa9cc98da41f09c5fd73a8be39) @@ -204,6 +204,10 @@ *************************************************************************/ void checkInFromUI( void ) { + if ( FALSE == uiDidCommunicate ) + { // Start DG check-in timer when UI first communicates + timeOfLastDGCheckIn = getMSTimerCount(); + } uiIsCommunicating = TRUE; timeOfLastUICheckIn = getMSTimerCount(); uiDidCommunicate = TRUE; @@ -930,11 +934,12 @@ { activateAlarmNoData( ALARM_ID_UI_COMM_TIMEOUT ); } + if ( TRUE == didTimeout( timeOfLastDGCheckIn, DG_COMM_TIMEOUT_IN_MS ) ) + { + activateAlarmNoData( ALARM_ID_DG_COMM_TIMEOUT ); + dgIsCommunicating = FALSE; + } } - if ( TRUE == didTimeout( timeOfLastDGCheckIn, DG_COMM_TIMEOUT_IN_MS ) ) - { - dgIsCommunicating = FALSE; - } } /*********************************************************************//**