Index: firmware/App/Modes/Dialysis.c =================================================================== diff -u -r57a46c4ea06d840444d7f6e02f1bc0fde7a1c37f -rb312b584da8ee69cb73fcf5680064f9cb55eb259 --- firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 57a46c4ea06d840444d7f6e02f1bc0fde7a1c37f) +++ firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision b312b584da8ee69cb73fcf5680064f9cb55eb259) @@ -232,12 +232,12 @@ { HEPARIN_STATE_T currentHeparinState = getHeparinState(); U32 preStop = getTreatmentParameterU32( TREATMENT_PARAM_HEPARIN_PRE_STOP_TIME ); - U32 minRem = getTreatmentTimeRemainingSecs() / SEC_PER_MIN; + F32 minRem = (F32)getTreatmentTimeRemainingSecs() / (F32)SEC_PER_MIN; F32 bolusVol = getTreatmentParameterF32( TREATMENT_PARAM_HEPARIN_BOLUS_VOLUME ); F32 hepRate = getTreatmentParameterF32( TREATMENT_PARAM_HEPARIN_DISPENSE_RATE ); // Do not run syringe pump if no Heparin included in prescription or it was paused or if Heparin should be stopped at this stage of treatment - if ( ( minRem > preStop ) && ( HEPARIN_STATE_STOPPED == currentHeparinState ) ) + if ( ( minRem > (F32)preStop ) && ( HEPARIN_STATE_STOPPED == currentHeparinState ) ) { // If not done with bolus, start/resume bolus if ( ( bolusVol > 0.0 ) && ( getSyringePumpVolumeDelivered() < bolusVol ) ) @@ -607,10 +607,10 @@ { DIALYSIS_STATE_T result = DIALYSIS_UF_STATE; U32 preStop = getTreatmentParameterU32( TREATMENT_PARAM_HEPARIN_PRE_STOP_TIME ); - U32 minRem = getTreatmentTimeRemainingSecs() / SEC_PER_MIN; + F32 minRem = (F32)getTreatmentTimeRemainingSecs() / (F32)SEC_PER_MIN; // Stop Heparin delivery if we have reached Heparin pre-stop point - if ( getTreatmentTimeRemainingSecs() < preStop ) + if ( minRem <= (F32)preStop ) { stopSyringePump(); setHeparinCompleted();