Index: firmware/App/Modes/Rinseback.c =================================================================== diff -u -raa0e314e638a2b7958980ef6706df52017ad337e -r3969e8aaa110f89c8fa67553517498627be84c66 --- firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision aa0e314e638a2b7958980ef6706df52017ad337e) +++ firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision 3969e8aaa110f89c8fa67553517498627be84c66) @@ -58,7 +58,7 @@ /// Maximum time allowed after rinseback operation completed. Timer is reset whenever BP is running (additional). static const U32 MAX_RINSEBACK_DONE_TIME = ( 15 * SEC_PER_MIN * ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ); /// Warning time after rinseback operation completed. Timer is reset whenever BP is running (additional). -static const U32 RINSEBACK_DONE_WARNING_TIME = ( 14 * SEC_PER_MIN * ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ); +static const U32 RINSEBACK_DONE_WARNING_TIME = ( 13 * SEC_PER_MIN * ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ); /// Maximum time allowed for each additional rinseback volume delivery. static const U32 MAX_RINSEBACK_ADDITIONAL_TIME = ( 20 * MS_PER_SECOND / TASK_GENERAL_INTERVAL ); /// Multiplier to convert flow (mL/min) into volume (mL) for period of general task interval. @@ -536,7 +536,7 @@ clearAlarm( ALARM_ID_HD_TREATMENT_RINSEBACK_TIMEOUT_WARNING ); } // Have we been in this stopped state for too long despite having delivered full blood volume back to patient? - else if ( ( rinsebackTimerCtr > RINSEBACK_DONE_WARNING_TIME ) && ( getRinsebackVolume() >= TARGET_RINSEBACK_VOLUME_ML ) ) + else if ( ( RINSEBACK_DONE_WARNING_TIME == rinsebackTimerCtr ) && ( getRinsebackVolume() >= TARGET_RINSEBACK_VOLUME_ML ) ) { activateAlarmNoData( ALARM_ID_HD_TREATMENT_RINSEBACK_TIMEOUT_WARNING ); } @@ -620,6 +620,11 @@ if ( RINSEBACK_STOP_STATE == result ) { setupForRinsebackStopOrPause(); + // If this additional rinseback volume has brought us to "full" rinseback volume, set flag + if ( getRinsebackVolume() >= TARGET_RINSEBACK_VOLUME_ML ) + { + setRinsebackIsCompleted( TRUE ); + } } return result;