Index: firmware/App/Controllers/DGInterface.c =================================================================== diff -u -ra5b84c018934c938b28c9b6671a6ae842f899e19 -rf373b6c38077c7e6071939e702fab65db58c1146 --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision a5b84c018934c938b28c9b6671a6ae842f899e19) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision f373b6c38077c7e6071939e702fab65db58c1146) @@ -774,31 +774,6 @@ /*********************************************************************//** * @brief - * The setDefaultTreatmentHeatingParams function calculates and set the default heating - * parameters to be sent to DG. - * @details Inputs: treatment dialysate temperature, treatment dialysate flow - * @details Outputs: none - * @return none - *************************************************************************/ -void setDefaultTreatmentHeatingParams( void ) -{ - DG_CMD_DIALYSATE_HEATING_PARAMS_T params; - - F32 targetTempC = getTreatmentParameterF32( TREATMENT_PARAM_DIALYSATE_TEMPERATURE ); - U32 dialysateFlowMLPM = getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ); - F32 fillTimeMS = ( (F32)DEFAULT_FILL_RESERVOIR_TO_VOLUME_ML / ( DEFAULT_TARGET_FILL_FLOW_RATE_LPM * ML_PER_LITER ) ) * SEC_PER_MIN * MS_PER_SECOND; - - params.trimmerTargetTemperature = targetTempC; - params.timeReservoirWait2SwitchMS = 0; - params.timeReservoirFillMS = fillTimeMS; - params.timeReservoirCycleMS = (U32)fillTimeMS; - params.dialysateFlowLPM = ( (F32)dialysateFlowMLPM ) / ML_PER_LITER; - params.usePriTargetTempEquation = FALSE; - cmdSetDGDialysateHeatingParams( params ); -} - -/*********************************************************************//** - * @brief * The cmdSetDGDialysateHeatingParams function sends the dialysate heating * parameters to DG. * @details Inputs: none Index: firmware/App/Controllers/DGInterface.h =================================================================== diff -u -ra5b84c018934c938b28c9b6671a6ae842f899e19 -rf373b6c38077c7e6071939e702fab65db58c1146 --- firmware/App/Controllers/DGInterface.h (.../DGInterface.h) (revision a5b84c018934c938b28c9b6671a6ae842f899e19) +++ firmware/App/Controllers/DGInterface.h (.../DGInterface.h) (revision f373b6c38077c7e6071939e702fab65db58c1146) @@ -31,7 +31,6 @@ */ // ********** public definitions ********** -#define DEFAULT_FILL_RESERVOIR_TO_VOLUME_ML 1500 ///< default Fill reservoir to this volume (in mL). #define DEFAULT_TARGET_FILL_FLOW_RATE_LPM 0.8F ///< Default target fill flow rate in L/min. #define DRAIN_RESERVOIR_TO_VOLUME_ML 0 ///< Drain reservoir to this volume (in mL) during treatment. #define LOAD_CELL_ILLEGAL_WEIGHT_VALUE -10000.0F ///< Initial value for Load Cells, known bad value @@ -132,7 +131,6 @@ void setHDVersionDGServiceRecord( DG_SERVICE_RECORD_T* data ); void setHDVersionDGUsageInfo( DG_USAGE_INFO_RECORD_T* data ); -void setDefaultTreatmentHeatingParams( void ); void cmdSetDGDialysateHeatingParams( DG_CMD_DIALYSATE_HEATING_PARAMS_T heatingParams ); void cmdStartDG( void ); void cmdStopDG( void ); Index: firmware/App/Modes/ModePreTreat.c =================================================================== diff -u -r736cc5b56cc9c784ab1d8fc8687a73d190c35759 -rf373b6c38077c7e6071939e702fab65db58c1146 --- firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision 736cc5b56cc9c784ab1d8fc8687a73d190c35759) +++ firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision f373b6c38077c7e6071939e702fab65db58c1146) @@ -143,7 +143,6 @@ static PRE_TREATMENT_RESERVOIR_MGMT_STATE_T handlePreTreatmentReservoirMgmtWaitReservoirSwitchState( void ); static void handlePreTreatmentReservoirMgmtCompleteState( void ); static U32 getPreTreatmentFillVolume( DG_RESERVOIR_ID_T inactiveRes ); -static void setPreTreatmentHeatingParams( F32 targetTempC, U32 targetVolML, F32 targetFillFlowLPM, U32 dialysateFlowMLPM ); // Test configuration test function and final drain correction at patient connect static void execPreTreatmentTestConfigReservoirMgmt( void ); @@ -613,6 +612,32 @@ /*********************************************************************//** * @brief + * The setPreTreatmentHeatingParams function calculates and set the heating + * parameters to be sent to DG. + * @details Inputs: none + * @details Outputs: none + * @param targetTempC target temperature in C + * @param targetVolML target fill volume in milliliters + * @param targetFillFlowLPM target fill flow rate in L/min + * @param dialysateFlowMLPM dialysate flow in mL/min + * @return none + *************************************************************************/ +void setPreTreatmentHeatingParams( F32 targetTempC, U32 targetVolML, F32 targetFillFlowLPM, U32 dialysateFlowMLPM ) +{ + DG_CMD_DIALYSATE_HEATING_PARAMS_T params; + F32 fillTimeMS = ( (F32)targetVolML / ( targetFillFlowLPM * ML_PER_LITER ) ) * SEC_PER_MIN * MS_PER_SECOND; + + params.trimmerTargetTemperature = targetTempC; + params.timeReservoirWait2SwitchMS = 0; + params.timeReservoirFillMS = fillTimeMS; + params.timeReservoirCycleMS = (U32)fillTimeMS; + params.dialysateFlowLPM = ( (F32)dialysateFlowMLPM ) / ML_PER_LITER; + params.usePriTargetTempEquation = FALSE; + cmdSetDGDialysateHeatingParams( params ); +} + +/*********************************************************************//** + * @brief * The publishPreTreatmentState function broadcasts pre-treatment sub-mode * and current sub-mode state. * @details Inputs: pre-treatment sub-mode, state @@ -1622,32 +1647,6 @@ return volume; } -/*********************************************************************//** - * @brief - * The setPreTreatmentHeatingParams function calculates and set the heating - * parameters to be sent to DG. - * @details Inputs: none - * @details Outputs: none - * @param targetTempC target temperature in C - * @param targetVolML target fill volume in milliliters - * @param targetFillFlowLPM target fill flow rate in L/min - * @param dialysateFlowMLPM dialysate flow in mL/min - * @return none - *************************************************************************/ -static void setPreTreatmentHeatingParams( F32 targetTempC, U32 targetVolML, F32 targetFillFlowLPM, U32 dialysateFlowMLPM ) -{ - DG_CMD_DIALYSATE_HEATING_PARAMS_T params; - F32 fillTimeMS = ( (F32)targetVolML / ( targetFillFlowLPM * ML_PER_LITER ) ) * SEC_PER_MIN * MS_PER_SECOND; - - params.trimmerTargetTemperature = targetTempC; - params.timeReservoirWait2SwitchMS = 0; - params.timeReservoirFillMS = fillTimeMS; - params.timeReservoirCycleMS = (U32)fillTimeMS; - params.dialysateFlowLPM = ( (F32)dialysateFlowMLPM ) / ML_PER_LITER; - params.usePriTargetTempEquation = FALSE; - cmdSetDGDialysateHeatingParams( params ); -} - /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ Index: firmware/App/Modes/ModePreTreat.h =================================================================== diff -u -r736cc5b56cc9c784ab1d8fc8687a73d190c35759 -rf373b6c38077c7e6071939e702fab65db58c1146 --- firmware/App/Modes/ModePreTreat.h (.../ModePreTreat.h) (revision 736cc5b56cc9c784ab1d8fc8687a73d190c35759) +++ firmware/App/Modes/ModePreTreat.h (.../ModePreTreat.h) (revision f373b6c38077c7e6071939e702fab65db58c1146) @@ -63,6 +63,9 @@ void signalAllowDGFillRes1( void ); // Signal that indicates the HD may begin filling reservoir 1 (after flushes completed) void signalAllowDGFillRes2( void ); // Signal that indicates the HD may begin filling reservoir 2 (after flushes completed) +// Set the trimmer heating parameters +void setPreTreatmentHeatingParams( F32 targetTempC, U32 targetVolML, F32 targetFillFlowLPM, U32 dialysateFlowMLPM ); + void signalAlarmActionToPreTreatmentMode( ALARM_ACTION_T action ); // Execute alarm action as appropriate for pre-treatment mode BOOL getReservoirFillStatus( DG_RESERVOIR_ID_T reservoirID ); // Get the fill complete status for given reservoir Index: firmware/App/Modes/Rinseback.c =================================================================== diff -u -ra5b84c018934c938b28c9b6671a6ae842f899e19 -rf373b6c38077c7e6071939e702fab65db58c1146 --- firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision a5b84c018934c938b28c9b6671a6ae842f899e19) +++ firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision f373b6c38077c7e6071939e702fab65db58c1146) @@ -45,6 +45,7 @@ #define DEFAULT_RINSEBACK_FLOW_RATE_ML_MIN 200 ///< Default rinseback flow rate (in mL/min). #define MIN_RINSEBACK_FLOW_RATE_ML_MIN 100 ///< Minimum rinseback flow rate (in mL/min). #define MAX_RINSEBACK_FLOW_RATE_ML_MIN 300 ///< Maximum rinseback flow rate (in mL/min). +#define DEFAULT_FILL_RESERVOIR_TO_VOLUME_ML 1500 ///< default Fill reservoir to this volume (in mL). /// Interval at which rinseback progress is to be published to UI. #define RINSEBACK_DATA_PUBLISH_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) @@ -188,14 +189,17 @@ stopSyringePump(); endAirTrapControl(); - // if DG restarted for some reason, lets make sure we set the heating parameters first before commanding to + // If DG restarted for some reason, lets make sure we set the heating parameters first before commanding to // turn on the trimmer heater and start the DG as well. if ( DG_MODE_STAN == getDGOpMode() ) { - // set the trimmer heating parameters - setDefaultTreatmentHeatingParams(); + F32 targetTempC = getTreatmentParameterF32( TREATMENT_PARAM_DIALYSATE_TEMPERATURE ); + U32 dialysateFlowMLPM = getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ); - // start the DG + // Set the heating parameters + setPreTreatmentHeatingParams( targetTempC, DEFAULT_FILL_RESERVOIR_TO_VOLUME_ML, DEFAULT_TARGET_FILL_FLOW_RATE_LPM, dialysateFlowMLPM ); + + // Start the DG cmdStartDG(); }