Index: firmware/App/Modes/BloodPrime.c =================================================================== diff -u -r61716bc97ecca8af1ec560333844a8cf602eccb0 -rb03a3ed91ebe15cfb419e34018f8fe600e744b4b --- firmware/App/Modes/BloodPrime.c (.../BloodPrime.c) (revision 61716bc97ecca8af1ec560333844a8cf602eccb0) +++ firmware/App/Modes/BloodPrime.c (.../BloodPrime.c) (revision b03a3ed91ebe15cfb419e34018f8fe600e744b4b) @@ -36,7 +36,7 @@ // ********** private definitiions *********** -#define TARGET_BLOOD_PRIME_VOLUME_ML 300.0 ///< Target blood prime volume to prime the blood side circuit (in mL). +#define TUBING_BLOOD_PRIME_VOLUME_ML 80.0 ///< Target blood prime volume to prime the blood side circuit (in mL). #define MAX_BLOOD_PRIME_VOLUME_ERROR_ML 60.0 ///< Maximum error in total additional blood prime volume (20% of total). #define MIN_RAMP_TIME_SEC 60 ///< Minimum ramp time for blood prime (in seconds). @@ -58,6 +58,7 @@ static F32 bloodPrimeRampFlowRate_mL_min; ///< Current blood pump ramp flow rate. static F32 bloodPrimeRampStep_mL; ///< Blood pump volume step size for ramping. +static F32 bloodPrimeTargetVolume_mL = 300.0; ///< Calculated target blood prime volume (based on selected dialyzer and fixed tubing volume). static U32 bloodPrimeRampControlTimerCtr; ///< Timer counter for determining interval for controlling BP ramp. static U32 bloodPrimePublishTimerCtr; ///< Timer counter for determining interval for blood prime status to be published. @@ -94,6 +95,7 @@ expectedBloodPrimeVolume_mL = 0.0; resetBloodPrimeFlags(); + bloodPrimeTargetVolume_mL = (F32)TUBING_BLOOD_PRIME_VOLUME_ML + (F32)getDialyzerBloodVolume(); bloodPrimeRampFlowRate_mL_min = (F32)BLOOD_PRIME_INIT_BP_FLOW_RATE_ML_MIN; // Calculate BP ramp step size if ( setBPRate <= BLOOD_PRIME_INIT_BP_FLOW_RATE_ML_MIN ) @@ -103,7 +105,7 @@ else { F32 rampRateSpan = (F32)( setBPRate - BLOOD_PRIME_INIT_BP_FLOW_RATE_ML_MIN ); - F32 estRampSeconds = ( ( TARGET_BLOOD_PRIME_VOLUME_ML / (F32)setBPRate + TARGET_BLOOD_PRIME_VOLUME_ML / (F32)BLOOD_PRIME_INIT_BP_FLOW_RATE_ML_MIN ) / 2.0 ) * (F32)SEC_PER_MIN; + F32 estRampSeconds = ( ( bloodPrimeTargetVolume_mL / (F32)setBPRate + bloodPrimeTargetVolume_mL / (F32)BLOOD_PRIME_INIT_BP_FLOW_RATE_ML_MIN ) / 2.0 ) * (F32)SEC_PER_MIN; if ( estRampSeconds < (F32)MIN_RAMP_TIME_SEC ) { @@ -225,7 +227,7 @@ expectedBloodPrimeVolume_mL += ( (F32)getTargetBloodFlowRate() * BLOOD_PRIME_FLOW_INTEGRATOR ); // Has blood prime completed? - if ( getBloodPrimeVolume() >= TARGET_BLOOD_PRIME_VOLUME_ML ) + if ( getBloodPrimeVolume() >= bloodPrimeTargetVolume_mL ) { initBloodPrime(); // Reset blood prime so that we start anew next time we transition to this sub-mode setBloodIsPrimed( TRUE ); // Signal treatment mode that blood prime is completed @@ -287,7 +289,7 @@ BLOOD_PRIME_DATA_PAYLOAD_T data; bloodPrimePublishTimerCtr = 0; - data.targetBloodPrimeVolumeMl = TARGET_BLOOD_PRIME_VOLUME_ML; + data.targetBloodPrimeVolumeMl = bloodPrimeTargetVolume_mL; data.deliveredBloodPrimeVolumeMl = getBloodPrimeVolume(); data.unused = 0.0; // TODO - remove later when UI no longer looking for this field. broadcastData( MSG_ID_HD_BLOOD_PRIME_PROGRESS, COMM_BUFFER_OUT_CAN_HD_BROADCAST, (U08*)&data, sizeof( BLOOD_PRIME_DATA_PAYLOAD_T ) ); Index: firmware/App/Modes/ModeTreatmentParams.h =================================================================== diff -u -r24b2fe72608344e67ef37234085d15ad5e4fcc37 -rb03a3ed91ebe15cfb419e34018f8fe600e744b4b --- firmware/App/Modes/ModeTreatmentParams.h (.../ModeTreatmentParams.h) (revision 24b2fe72608344e67ef37234085d15ad5e4fcc37) +++ firmware/App/Modes/ModeTreatmentParams.h (.../ModeTreatmentParams.h) (revision b03a3ed91ebe15cfb419e34018f8fe600e744b4b) @@ -89,12 +89,12 @@ BOOL setTreatmentParameterU32( TREATMENT_PARAM_T param, U32 value ); // Set a specified unsigned integer treatment parameter value BOOL setTreatmentParameterS32( TREATMENT_PARAM_T param, S32 value ); // Set a specified signed integer treatment parameter value BOOL setTreatmentParameterF32( TREATMENT_PARAM_T param, F32 value ); // Set a specified floating point treatment parameter value -U32 getTreatmentParameterU32( TREATMENT_PARAM_T param ); // Get a specified unsigned integer treatment parameter -S32 getTreatmentParameterS32( TREATMENT_PARAM_T param ); // Get a specified signed integer treatment parameter -F32 getTreatmentParameterF32( TREATMENT_PARAM_T param ); // Get a specified floating point treatment parameter +U32 getTreatmentParameterU32( TREATMENT_PARAM_T param ); // Get a specified unsigned integer treatment parameter +S32 getTreatmentParameterS32( TREATMENT_PARAM_T param ); // Get a specified signed integer treatment parameter +F32 getTreatmentParameterF32( TREATMENT_PARAM_T param ); // Get a specified floating point treatment parameter BOOL isTreatmentParamInRange( TREATMENT_PARAM_T param, CRITICAL_DATAS_T value ); // Check range for a proposed treatment parameter value -F32 getUltrafiltrationVolumeOriginal( void ); // Get the original ultrafiltration volume, set in pre-treatment mode by user. -F32 getUltrafiltrationRateOriginal( void ); // Get/calculate the original ultrafiltration rate, by ultrafiltration volume and treatment duration set in pre-treatment mode by user. +F32 getUltrafiltrationVolumeOriginal( void ); // Get the original ultrafiltration volume, set in pre-treatment mode by user. +F32 getUltrafiltrationRateOriginal( void ); // Get/calculate the original ultrafiltration rate, by ultrafiltration volume and treatment duration set in pre-treatment mode by user. BOOL testSetTreatmentParameter( TREATMENT_PARAM_T param, CRITICAL_DATAS_T value ); // Set a specific treatment parameter value Index: firmware/App/Modes/Prime.c =================================================================== diff -u -rdcd569e6556c82096a67d738a58878e944d5d100 -rb03a3ed91ebe15cfb419e34018f8fe600e744b4b --- firmware/App/Modes/Prime.c (.../Prime.c) (revision dcd569e6556c82096a67d738a58878e944d5d100) +++ firmware/App/Modes/Prime.c (.../Prime.c) (revision b03a3ed91ebe15cfb419e34018f8fe600e744b4b) @@ -61,62 +61,62 @@ /// States of the treatment reservoir management state machine. typedef enum PrimeReservoirMgmt_States { - PRIME_RESERVOIR_MGMT_START_STATE = 0, ///< If DG not already in re-circ mode, try to get it there. - PRIME_RESERVOIR_MGMT_FLUSH_DG_LINES_STATE, ///< In DG re-circ, wait for lines to flush - then start draining inactive reservoir. - PRIME_RESERVOIR_MGMT_WAIT_FOR_DRAIN_CMD_RESP, ///< After sending drain command, wait for DG to response back. - PRIME_RESERVOIR_MGMT_DRAIN_STATE, ///< Wait for drain to complete. - PRIME_RESERVOIR_MGMT_START_FILL_STATE, ///< Command DG to start filling reservoir. - PRIME_RESERVOIR_MGMT_WAIT_FOR_FILL_CMD_RESP, ///< After sending fill command, wait for DG to response back. - PRIME_RESERVOIR_MGMT_FILL_STATE, ///< Wait for fill to complete. - PRIME_RESERVOIR_MGMT_FILL_COMPLETE_STATE, ///< Reservoir fill has completed. - PRIME_RESERVOIR_MGMT_WAIT_RESERVOIR_TWO_INACTIVE, ///< Wait for reservoir 2 become inactive. - NUM_OF_PRIME_RESERVOIR_MGMT_STATES ///< Number of prime reservoir mgmt. states. + PRIME_RESERVOIR_MGMT_START_STATE = 0, ///< If DG not already in re-circ mode, try to get it there. + PRIME_RESERVOIR_MGMT_FLUSH_DG_LINES_STATE, ///< In DG re-circ, wait for lines to flush - then start draining inactive reservoir. + PRIME_RESERVOIR_MGMT_WAIT_FOR_DRAIN_CMD_RESP, ///< After sending drain command, wait for DG to response back. + PRIME_RESERVOIR_MGMT_DRAIN_STATE, ///< Wait for drain to complete. + PRIME_RESERVOIR_MGMT_START_FILL_STATE, ///< Command DG to start filling reservoir. + PRIME_RESERVOIR_MGMT_WAIT_FOR_FILL_CMD_RESP, ///< After sending fill command, wait for DG to response back. + PRIME_RESERVOIR_MGMT_FILL_STATE, ///< Wait for fill to complete. + PRIME_RESERVOIR_MGMT_FILL_COMPLETE_STATE, ///< Reservoir fill has completed. + PRIME_RESERVOIR_MGMT_WAIT_RESERVOIR_TWO_INACTIVE, ///< Wait for reservoir 2 become inactive. + NUM_OF_PRIME_RESERVOIR_MGMT_STATES ///< Number of prime reservoir mgmt. states. } PRIME_RESERVOIR_MGMT_STATE_T; typedef struct { - U32 bloodVolume; ///< Blood volume of the dialyzer in mL. - U32 dialysateVolume; ///< Dialysate volume of the dialyzer in mL. + U32 bloodVolume; ///< Blood volume of the dialyzer in mL. + U32 dialysateVolume; ///< Dialysate volume of the dialyzer in mL. } DIALYZER_VOLUME_DATA_T; // ********** private data ********** -static DIALYZER_VOLUME_DATA_T dialyzerVolumeTable[ ] = { { 82, 170 }, ///< Dialyzer volume table in mL of five types of dialyzer - { 100, 200 }, - { 120, 257 }, - { 87, 233 }, - { 102, 280 } }; +/// Dialyzer volumes (blood and dialysate) table in mL for each type of dialyzer. +static DIALYZER_VOLUME_DATA_T dialyzerVolumeTable[ ] = + { { 82, 170 }, // DIALYZER_TYPE_BBRAUN_PRO_13H + { 100, 200 }, // DIALYZER_TYPE_BBRAUN_PRO_16H + { 120, 257 }, // DIALYZER_TYPE_BBRAUN_PRO_19H + { 87, 233 }, // DIALYZER_TYPE_FRESENIUS_OPTIFLUX_F160NRE + { 102, 280 } }; // DIALYZER_TYPE_FRESENIUS_OPTIFLUX_F180NRE -static U32 primeDialysateDialyzerTimeLimit; ///< Time limit in msec for priming dialysate dialyzer path. -static U32 primeSalineDialyzerTimeLimit; ///< Time limit in msec for priming saline dialyzer path. +static U32 primeDialysateDialyzerTimeLimit; ///< Time limit in msec for priming dialysate dialyzer path. +static U32 primeSalineDialyzerTimeLimit; ///< Time limit in msec for priming saline dialyzer path. -static HD_PRE_TREATMENT_PRIME_STATE_T currentPrimeState; ///< Current state of the prime sub-mode state machine. -static HD_PRE_TREATMENT_PRIME_STATE_T previousPrimeState; ///< Previous state of the prime sub-mode, to use when resuming from pause. -static PRIME_RESERVOIR_MGMT_STATE_T currentReservoirMgmtState; ///< Current reservoir management state. +static HD_PRE_TREATMENT_PRIME_STATE_T currentPrimeState; ///< Current state of the prime sub-mode state machine. +static HD_PRE_TREATMENT_PRIME_STATE_T previousPrimeState; ///< Previous state of the prime sub-mode, to use when resuming from pause. +static PRIME_RESERVOIR_MGMT_STATE_T currentReservoirMgmtState; ///< Current reservoir management state. -static U32 primeStartTime; ///< Starting time of priming (in ms). -static U32 primePauseStartTime; ///< Priming pause start time (in ms). -static U32 primeStatusBroadcastTimerCounter; ///< Prime status data broadcast timer counter used to schedule when to transmit data. +static U32 primeStartTime; ///< Starting time of priming (in ms). +static U32 primePauseStartTime; ///< Priming pause start time (in ms). +static U32 primeStatusBroadcastTimerCounter; ///< Prime status data broadcast timer counter used to schedule when to transmit data. -static BOOL primeStartRequested; ///< Flag indicates user requesting to start prime. -static BOOL primeResumeRequested; ///< Flag indicates user requesting prime resume. +static BOOL primeStartRequested; ///< Flag indicates user requesting to start prime. +static BOOL primeResumeRequested; ///< Flag indicates user requesting prime resume. -static U32 noAirDetectedStartTime; ///< starting time when detecting no air. -static U32 purgeAirTimeOutStartTime; ///< Starting time for purge air state time out. -static U32 primeSalineDialyzerStartTime; ///< Starting time of priming saline dialyzer circuit. -static U32 primeDialysateDialyzerStartTime; ///< Starting time of priming dialysate dialyzer circuit. -static U32 primeDialysateBypassStartTime; ///< Starting time of priming dialysate bypass circuit. -static U32 steadyVolumeSamplingStartTime; ///< Load cell steady volume sampling interval starting time. -static F32 minimumReservoirVolume; ///< Minimum reservoir volume in mL. -static U32 steadyVolumeCount; ///< Use to keep track the number of dVolume/dt < Threshold +static U32 noAirDetectedStartTime; ///< starting time when detecting no air. +static U32 purgeAirTimeOutStartTime; ///< Starting time for purge air state time out. +static U32 primeSalineDialyzerStartTime; ///< Starting time of priming saline dialyzer circuit. +static U32 primeDialysateDialyzerStartTime; ///< Starting time of priming dialysate dialyzer circuit. +static U32 primeDialysateBypassStartTime; ///< Starting time of priming dialysate bypass circuit. +static U32 steadyVolumeSamplingStartTime; ///< Load cell steady volume sampling interval starting time. +static F32 minimumReservoirVolume; ///< Minimum reservoir volume in mL. +static U32 steadyVolumeCount; ///< Use to keep track the number of dVolume/dt < Threshold // ********** private function prototypes ********** static void resetPrimeFlags(); static void setupForPrimePause( void ); static void broadcastPrimingStatus( void ); static void purgeAirValvesBloodPumpControl( void ); -static F32 getDialyzerBloodVolume( void ); -static F32 getDialyzerDialysateVolume( void ); static HD_PRE_TREATMENT_PRIME_STATE_T handlePrimeWaitForUserStartState( void ); static HD_PRE_TREATMENT_PRIME_STATE_T handlePrimeSalineDialyzerSetupState( void ); @@ -269,9 +269,9 @@ * the selected dialyzer. * @details Inputs: dialyzer volume table * @details Outputs: none - * @return blood volume capacity of the dialyzer in mL + * @return blood volume capacity of the selected dialyzer type in mL *************************************************************************/ -F32 getDialyzerBloodVolume( void ) +U32 getDialyzerBloodVolume( void ) { U32 dialyzerType = getTreatmentParameterU32( TREATMENT_PARAM_DIALYZER_TYPE ); @@ -284,9 +284,9 @@ * of the selected dialyzer. * @details Inputs: dialyzer volume table * @details Outputs: none - * @return dialysate volume capacity of the dialyzer in mL + * @return dialysate volume capacity of the selected dialyzer type in mL *************************************************************************/ -F32 getDialyzerDialysateVolume( void ) +U32 getDialyzerDialysateVolume( void ) { U32 dialyzerType = getTreatmentParameterU32( TREATMENT_PARAM_DIALYZER_TYPE ); Index: firmware/App/Modes/Prime.h =================================================================== diff -u -r24b2fe72608344e67ef37234085d15ad5e4fcc37 -rb03a3ed91ebe15cfb419e34018f8fe600e744b4b --- firmware/App/Modes/Prime.h (.../Prime.h) (revision 24b2fe72608344e67ef37234085d15ad5e4fcc37) +++ firmware/App/Modes/Prime.h (.../Prime.h) (revision b03a3ed91ebe15cfb419e34018f8fe600e744b4b) @@ -32,26 +32,24 @@ // ********** public definitions ********** -#pragma pack(push,1) - /// Payload record structure for a priming status data broadcast message. typedef struct { U32 totalTime; ///< Total priming time in seconds. U32 remainingTime; ///< Remaining time for priming in seconds. } PRIMING_DATA_PAYLOAD_T; -#pragma pack(pop) - // ********** public function prototypes ********** -void initPrime( void ); -void transitionToPrime( void ); -void execPrime( void ); -U32 getPrimeState( void ); +void initPrime( void ); // Initialize prime sub-mode (of pre-treatment mode). +void transitionToPrime( void ); // Transition to prime sub-mode (of pre-treatment mode). +void execPrime( void ); // Execute the prime state machine. +U32 getPrimeState( void ); // Get the current state of the prime state machine. +U32 getDialyzerBloodVolume( void ); // Get the blood volume (in mL) associated with a given dialyzer type. +U32 getDialyzerDialysateVolume( void ); // Get the dialysate volume (in mL) associated with a given dialyzer type. -void signalStartPrime( void ); -void signalResumePrime( void ); +void signalStartPrime( void ); // User has requested to start prime +void signalResumePrime( void ); // User has requested to resume prime /**@}*/ Index: firmware/App/Modes/Rinseback.c =================================================================== diff -u -r24b2fe72608344e67ef37234085d15ad5e4fcc37 -rb03a3ed91ebe15cfb419e34018f8fe600e744b4b --- firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision 24b2fe72608344e67ef37234085d15ad5e4fcc37) +++ firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision b03a3ed91ebe15cfb419e34018f8fe600e744b4b) @@ -37,7 +37,7 @@ // ********** private definitions ********** -#define TARGET_RINSEBACK_VOLUME_ML 300.0 ///< Target rinseback volume to deliver back to the patient (in mL). TODO - get from Systems when available +#define TUBING_RINSEBACK_VOLUME_ML 80.0 ///< Target rinseback volume to deliver back to the patient (in mL). #define MAX_TOTAL_ADDITIONAL_RINSEBACK_VOLUME_ML 300.0 ///< Maximum total additional rinseback volume allowed : all additionals (in mL). #define MAX_RINSEBACK_VOLUME_ERROR_ML 60.0 ///< Maximum error in total additional rinseback volume (20% of total). #define TARGET_ADDITIONAL_RINSEBACK_VOLUME_ML 10.0 ///< Target rinseback volume for an additional volume request (in mL). @@ -64,6 +64,7 @@ static U32 rinsebackRate_mL_min; ///< Rinseback rate to use/adjust for this current rinseback only. static U32 rinsebackTimerCtr; ///< Timer counter for time spent in rinseback sub-mode. +static F32 rinsebackTargetVolume_mL = 300.0; ///< Calculated target rinseback volume (based on selected dialyzer and fixed tubing volume). static OVERRIDE_F32_T cumulativeRinsebackVolume_mL = { 0.0, 0.0, 0.0, 0 }; ///< Total cumulative rinseback volume (in mL) from measured blood flow rate. static F32 expectedRinsebackVolume_mL = 0.0; ///< Total cumulative rinseback volume (in mL) expected based on target blood flow rate. static F32 targetRinsebackVolumePlusAdditional_mL; ///< Target rinseback volume w/ additional volume(s) added (in mL). @@ -125,7 +126,8 @@ { rinsebackState = RINSEBACK_STOP_INIT_STATE; rinsebackRate_mL_min = getTreatmentParameterU32( TREATMENT_PARAM_RINSEBACK_FLOW_RATE ); - targetRinsebackVolumePlusAdditional_mL = TARGET_RINSEBACK_VOLUME_ML; + rinsebackTargetVolume_mL = TUBING_RINSEBACK_VOLUME_ML + (F32)getDialyzerBloodVolume(); + targetRinsebackVolumePlusAdditional_mL = rinsebackTargetVolume_mL; rinsebackTimerCtr = 0; cumulativeRinsebackVolume_mL.data = 0.0; expectedRinsebackVolume_mL = 0.0; @@ -378,7 +380,7 @@ result = RINSEBACK_STOP_STATE; } // Has rinseback completed? - else if ( getRinsebackVolume() >= TARGET_RINSEBACK_VOLUME_ML ) + else if ( getRinsebackVolume() >= rinsebackTargetVolume_mL ) { setRinsebackIsCompleted( TRUE ); setupForRinsebackStopOrPause(); @@ -482,20 +484,20 @@ RINSEBACK_STATE_T result = RINSEBACK_STOP_STATE; // Have we been in this stopped state for too long w/o having delivered full blood volume back to patient? - if ( ( rinsebackTimerCtr > MAX_RINSEBACK_TIME ) && ( getRinsebackVolume() < TARGET_RINSEBACK_VOLUME_ML ) ) + if ( ( rinsebackTimerCtr > MAX_RINSEBACK_TIME ) && ( getRinsebackVolume() < rinsebackTargetVolume_mL ) ) { signalGoToTreatmentStopped(); activateAlarmNoData( ALARM_ID_TREATMENT_RINSEBACK_TIMEOUT_ALARM ); } // Have we been in this stopped state for too long despite having delivered full blood volume back to patient? - else if ( ( rinsebackTimerCtr > MAX_RINSEBACK_DONE_TIME ) && ( getRinsebackVolume() >= TARGET_RINSEBACK_VOLUME_ML ) ) + else if ( ( rinsebackTimerCtr > MAX_RINSEBACK_DONE_TIME ) && ( getRinsebackVolume() >= rinsebackTargetVolume_mL ) ) { signalGoToTreatmentStopped(); activateAlarmNoData( ALARM_ID_TREATMENT_RINSEBACK_TIMEOUT_ALARM ); 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 ( ( RINSEBACK_DONE_WARNING_TIME == rinsebackTimerCtr ) && ( getRinsebackVolume() >= TARGET_RINSEBACK_VOLUME_ML ) ) + else if ( ( RINSEBACK_DONE_WARNING_TIME == rinsebackTimerCtr ) && ( getRinsebackVolume() >= rinsebackTargetVolume_mL ) ) { activateAlarmNoData( ALARM_ID_HD_TREATMENT_RINSEBACK_TIMEOUT_WARNING ); } @@ -507,7 +509,7 @@ { additionalRinsebackRequested = FALSE; // deliver additional rinseback volume only if max volume not reached and max time not reached - if ( ( rinsebackTimerCtr < MAX_RINSEBACK_TIME ) || ( getRinsebackVolume() >= TARGET_RINSEBACK_VOLUME_ML ) ) + if ( ( rinsebackTimerCtr < MAX_RINSEBACK_TIME ) || ( getRinsebackVolume() >= rinsebackTargetVolume_mL ) ) { rinsebackAdditionalTimerCtr = 0; additionalRinsebackVolume_mL = 0.0; @@ -580,7 +582,7 @@ { setupForRinsebackStopOrPause(); // If this additional rinseback volume has brought us to "full" rinseback volume, set flag - if ( getRinsebackVolume() >= TARGET_RINSEBACK_VOLUME_ML ) + if ( getRinsebackVolume() >= rinsebackTargetVolume_mL ) { setRinsebackIsCompleted( TRUE ); } @@ -896,7 +898,7 @@ { *rejReason = REQUEST_REJECT_REASON_ACTION_DISABLED_IN_CURRENT_STATE; } - else if ( getRinsebackVolume() < TARGET_RINSEBACK_VOLUME_ML ) + else if ( getRinsebackVolume() < rinsebackTargetVolume_mL ) { *rejReason = REQUEST_REJECT_REASON_RINSEBACK_NOT_COMPLETED; } @@ -982,7 +984,7 @@ { RINSEBACK_DATA_PAYLOAD_T data; U32 timeout = MAX_RINSEBACK_TIME / ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ); - U32 countdown = ( getRinsebackVolume() >= TARGET_RINSEBACK_VOLUME_ML ? MAX_RINSEBACK_DONE_TIME : MAX_RINSEBACK_TIME ); + U32 countdown = ( getRinsebackVolume() >= rinsebackTargetVolume_mL ? MAX_RINSEBACK_DONE_TIME : MAX_RINSEBACK_TIME ); countdown -= rinsebackTimerCtr; // Handle countdown past zero @@ -993,10 +995,10 @@ // Scale to seconds countdown /= ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ); - data.targetRinsebackVolumeMl = TARGET_RINSEBACK_VOLUME_ML; + data.targetRinsebackVolumeMl = rinsebackTargetVolume_mL; rinsebackPublishTimerCtr = 0; // If we have completed rinseback, timeout is no longer in force - indicate by zeroing timeout. Also include any additionals to target. - if ( ( rinsebackState > RINSEBACK_PAUSED_STATE ) && ( getRinsebackVolume() >= TARGET_RINSEBACK_VOLUME_ML ) ) + if ( ( rinsebackState > RINSEBACK_PAUSED_STATE ) && ( getRinsebackVolume() >= rinsebackTargetVolume_mL ) ) { data.targetRinsebackVolumeMl = targetRinsebackVolumePlusAdditional_mL; timeout = MAX_RINSEBACK_DONE_TIME / ( MS_PER_SECOND / TASK_GENERAL_INTERVAL );