Index: firmware/App/Modes/ModeGenDialysate.c =================================================================== diff -u -r158fa55faa114e13f998847c8a4900a901486bba -r9650047180a7b0ed919853d3526645c47445fe61 --- firmware/App/Modes/ModeGenDialysate.c (.../ModeGenDialysate.c) (revision 158fa55faa114e13f998847c8a4900a901486bba) +++ firmware/App/Modes/ModeGenDialysate.c (.../ModeGenDialysate.c) (revision 9650047180a7b0ed919853d3526645c47445fe61) @@ -85,7 +85,7 @@ //Testing static U32 bypassStateDelayStartTimeMS; ///< Delay balancing chamber switching for a second to preapre pump steady state. static BOOL delayBypassStateFlag; ///< To indicate change in treatment parameters -static F32 dialysateFlowRate; +static F32 dialysateFlowRate; ///< Current dialysate flow rate (ml/min) // ********** private function prototypes ********** @@ -98,6 +98,7 @@ static DD_GEND_MODE_STATE_T handleGenDIsolatedUFState( void ); static F32 getGenDialysateTargetTemperature( void ); static void calculateTargetDialysateTemp( void ); +static void updateDialysateFlowRate( void ); static void checkDialysateTemperature( void ); static void monitorChamberLevelStatus( void ); static void publishGenDialysateModeData( void ); @@ -366,7 +367,7 @@ #endif // Update dialysate flow rate changes received from TD - updateDialysateFlow(); + updateDialysateFlowRate(); //Check temperature drift between D30 and D28 checkDialysateTemperatureSensors(); @@ -820,24 +821,24 @@ /*********************************************************************//** * @brief - * The updateDialysateFlow function updates the target Qd depending on the + * The updateDialysateFlowRate function updates the target Qd depending on the * state of the balancing chamber. - * @details \b Inputs: none + * @details \b Inputs: genDialysateState * @details \b Outputs: dialysateFlowRate * @return none *************************************************************************/ -void updateDialysateFlow( void ) +void updateDialysateFlowRate( void ) { // Check the operation mode - if ( DD_MODE_GEND == getCurrentOperationMode() ) + if ( DD_GEND_DIALYSATE_DELIVERY_STATE == genDialysateState ) { // Update the dialysate flow rate to the TD request dialysateFlowRate = getTDDialysateFlowrate(); } else { // Set the dialysate flow rate to zero - dialysateFlowRate = getTDDialysateFlowrate(); + dialysateFlowRate = 0; } } @@ -983,7 +984,7 @@ data.d18Pressure = getFilteredPressure( D18_PRES ); data.d51Pressure = getFilteredPressure( D51_PRES ); data.isDialysateGoodtoDeliver = (BOOL)getDialGoodToDeliverStatus(); - data.targetQd = dialysateFlowRate; + data.currentQd = dialysateFlowRate; broadcastData( MSG_ID_DD_GEN_DIALYSATE_MODE_DATA, COMM_BUFFER_OUT_CAN_DD_BROADCAST, (U08*)&data, sizeof( GEN_DIALYSATE_MODE_DATA_T ) );