Index: firmware/App/Controllers/DGInterface.c =================================================================== diff -u -r098272da7396d05816a266142e7a34b40f4d93d3 -r2f10acf23757a74e879449632b0c1ac09a88265a --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 098272da7396d05816a266142e7a34b40f4d93d3) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 2f10acf23757a74e879449632b0c1ac09a88265a) @@ -16,30 +16,30 @@ ***************************************************************************/ #include // To check for NaN - + #include "DialInFlow.h" #include "Dialysis.h" -#include "DGDefs.h" +#include "DGDefs.h" #include "DGInterface.h" #include "ModeInitPOST.h" #include "ModeTreatment.h" -#include "ModeTreatmentParams.h" -#include "OperationModes.h" +#include "ModeTreatmentParams.h" +#include "OperationModes.h" #include "PersistentAlarm.h" #include "SystemComm.h" -#include "SystemCommMessages.h" -#include "Timers.h" - -/** - * @addtogroup DGInterface - * @{ - */ - -// ********** private definitions ********** - -#define START_DG_CMD TRUE ///< Parameter for DG start/stop command function. True = start. -#define STOP_DG_CMD FALSE ///< Parameter for DG start/stop command function. False = stop. +#include "SystemCommMessages.h" +#include "Timers.h" +/** + * @addtogroup DGInterface + * @{ + */ + +// ********** private definitions ********** + +#define START_DG_CMD TRUE ///< Parameter for DG start/stop command function. True = start. +#define STOP_DG_CMD FALSE ///< Parameter for DG start/stop command function. False = stop. + #define SIZE_OF_LARGE_LOAD_CELL_AVG 32 ///< Large load cell moving average has 32 samples. #define DIALYSATE_TEMP_OUT_OF_TARGET_TOL_C 2.0F ///< Dialysate temperature out of target tolerance C. @@ -51,35 +51,35 @@ #define DG_DATA_FRESHNESS_TIMEOUT_MS ( 3 * MS_PER_SECOND ) ///< DG data freshness timeout (in ms). // ********** private data ********** - + static const U32 DIP_LOAD_CELL_DATA_MESSAGE_ALARM_THRESHOLD = ((2 * MS_PER_SECOND) / TASK_GENERAL_INTERVAL); static const U32 DIP_TEMPERATURE_DATA_MESSAGE_ALARM_THRESHOLD = ((2 * MS_PER_SECOND) / TASK_GENERAL_INTERVAL); static const U32 DIP_RESERVOIRS_DATA_MESSAGE_ALARM_THRESHOLD = ((2 * MS_PER_SECOND) / TASK_GENERAL_INTERVAL); static const U32 DIP_DG_OP_MODE_DATA_MESSAGE_ALARM_THRESHOLD = ((2 * MS_PER_SECOND) / TASK_GENERAL_INTERVAL); - -// DG status -static DG_OP_MODE_T dgCurrentOpMode = DG_MODE_INIT; ///< Current DG operation mode. + +// DG status +static DG_OP_MODE_T dgCurrentOpMode = DG_MODE_INIT; ///< Current DG operation mode. static U32 dgSubMode = 0; ///< Current state (sub-mode) of current DG operation mode. -static BOOL dgStartCommandSent = FALSE; ///< Flag indicates command to start DG has been sent. -static BOOL dgStarted = FALSE; ///< Flag indicates whether we have commanded the DG to start or stop. -static BOOL dgTrimmerHeaterOn = FALSE; ///< Flag indicates whether we have commanded the DG to start or stop the trimmer heater. - +static BOOL dgStartCommandSent = FALSE; ///< Flag indicates command to start DG has been sent. +static BOOL dgStarted = FALSE; ///< Flag indicates whether we have commanded the DG to start or stop. +static BOOL dgTrimmerHeaterOn = FALSE; ///< Flag indicates whether we have commanded the DG to start or stop the trimmer heater. + // State machine states -static U32 timeStartMS = 0; // TODO is this needed? - -// DG sensor data -static F32 dgDialysateTemp; ///< Dialysate temperature reported by the DG. -static F32 dgRedundantDialysateTemp = 0.0; ///< Redundant dialysate temperature reported by the DG. -static F32 dgPrimaryTemp = 0.0; ///< Latest RO water temperature reported by the DG. -static F32 dgTrimmerTempSet = 0.0; ///< Trimmer heater target temperature commanded. -static F32 dgTrimmerTemp = 0.0; ///< Latest dialysate temperature reported by the DG. - +static U32 timeStartMS = 0; // TODO is this needed? + +// DG sensor data +static F32 dgDialysateTemp; ///< Dialysate temperature reported by the DG. +static F32 dgRedundantDialysateTemp = 0.0; ///< Redundant dialysate temperature reported by the DG. +static F32 dgPrimaryTemp = 0.0; ///< Latest RO water temperature reported by the DG. +static F32 dgTrimmerTempSet = 0.0; ///< Trimmer heater target temperature commanded. +static F32 dgTrimmerTemp = 0.0; ///< Latest dialysate temperature reported by the DG. + /// Measured weight from load cells. static OVERRIDE_F32_T loadCellWeightInGrams[ NUM_OF_LOAD_CELLS ]; /// Filtered (32 sample) weight of reservoirs. static F32 lgFilteredReservoirWeightInGrams[ NUM_OF_DG_RESERVOIRS ]; static F32 lgFilteredReservoirBackupWeightInGrams[ NUM_OF_DG_RESERVOIRS ]; - + // Load cell filtering data static F32 lgLoadCellReadings[ NUM_OF_DG_RESERVOIRS ][ SIZE_OF_LARGE_LOAD_CELL_AVG ]; ///< Holds load cell samples for large load cell moving average. static U32 lgLoadCellReadingsIdx = 0; ///< Index for next sample in large load cell rolling average sample array. @@ -95,42 +95,42 @@ static BOOL dgReservoirsDataFreshFlag = FALSE; ///< Flag to signal the handleDGReservoirData() to process fresh reservoirs data static BOOL dgOpModeDataFreshFlag = FALSE; ///< Flag to signal the handleDGOpMode() to process fresh dg op mode data -// Reservoir data -static DG_RESERVOIR_ID_T dgActiveReservoir = DG_RESERVOIR_2; ///< Latest active reservoir reported by the DG. +// Reservoir data +static DG_RESERVOIR_ID_T dgActiveReservoir = DG_RESERVOIR_2; ///< Latest active reservoir reported by the DG. static DG_RESERVOIR_ID_T dgActiveReservoirSet = DG_RESERVOIR_2; ///< Active reservoir commanded. // TODO remove below variables -static U32 dgReservoirFillVolumeTarget = 0; ///< Latest fill-to volume reported by the DG. -static U32 dgReservoirFillVolumeTargetSet = 0; ///< Fill-to volume commanded. -static U32 dgReservoirDrainVolumeTarget = 0; ///< Latest drain-to volume reported by the DG. -static U32 dgReservoirDrainVolumeTargetSet = 0; ///< Drain-to volume commanded. +static U32 dgReservoirFillVolumeTarget = 0; ///< Latest fill-to volume reported by the DG. +static U32 dgReservoirFillVolumeTargetSet = 0; ///< Fill-to volume commanded. +static U32 dgReservoirDrainVolumeTarget = 0; ///< Latest drain-to volume reported by the DG. +static U32 dgReservoirDrainVolumeTargetSet = 0; ///< Drain-to volume commanded. static DG_DISINFECT_UI_STATES_T disinfectsStatus; ///< DG disinfects status. static DG_MIXING_RATIOS_T dgMixingRatios; ///< DG mixing ratios. // DG command response static DG_CMD_RESPONSE_T dgCmdResp[ NUM_OF_DG_COMMANDS ]; ///< Keep the latest DG command response for each command. - -// ********** private function prototypes ********** +// ********** private function prototypes ********** + static void checkDGRestart( void ); -/*********************************************************************//** - * @brief - * The initDGInterface function initializes the DGInterface module. - * @details Inputs: none - * @details Outputs: DGInterface module initialized. - * @return none - *************************************************************************/ -void initDGInterface( void ) -{ +/*********************************************************************//** + * @brief + * The initDGInterface function initializes the DGInterface module. + * @details Inputs: none + * @details Outputs: DGInterface module initialized. + * @return none + *************************************************************************/ +void initDGInterface( void ) +{ U32 i, j; - dgStarted = FALSE; - dgTrimmerHeaterOn = FALSE; - dgTrimmerTempSet = 0.0; - dgActiveReservoirSet = DG_RESERVOIR_2; - dgReservoirFillVolumeTargetSet = 0; + dgStarted = FALSE; + dgTrimmerHeaterOn = FALSE; + dgTrimmerTempSet = 0.0; + dgActiveReservoirSet = DG_RESERVOIR_2; + dgReservoirFillVolumeTargetSet = 0; dgReservoirDrainVolumeTargetSet = 0; // initialize load cell weights @@ -207,7 +207,7 @@ } } } - + /*********************************************************************//** * @brief * The execDGInterfaceMonitor function executes the DG Interface monitoring @@ -218,6 +218,12 @@ *************************************************************************/ void execDGInterfaceMonitor( void ) { + // Trigger alarm if not receiving new load cell data message in timely manner + checkDGDataFreshness( ALARM_ID_HD_NEW_LOAD_CELL_DATA_MESSAGE_NOT_RECEIVE, &dgLoadCellDataFreshFlag ); + + // Trigger alarm if not receiving new dialysate temperature data message in timely manner + checkDGDataFreshness( ALARM_ID_HD_NEW_DIALYSATE_TEMPERATURE_DATA_MESSAGE_NOT_RECEIVE, &dgDialysateTemperatureDataFreshFlag ); + // Trigger alarm if not receiving new reservoirs data message in timely manner checkDGDataFreshness( ALARM_ID_HD_NEW_RESERVOIRS_DATA_MESSAGE_NOT_RECEIVE, &dgReservoirsDataFreshFlag ); @@ -239,46 +245,46 @@ void dialysisResumed( void ) { timeStartMS = getMSTimerCount(); -} - -/*********************************************************************//** - * @brief - * The getDGOpMode function gets the current DG operating mode. - * @details Inputs: dgCurrentOpMode - * @details Outputs: none - * @return Current DG operating mode. - *************************************************************************/ -DG_OP_MODE_T getDGOpMode( void ) -{ - return dgCurrentOpMode; -} - -/*********************************************************************//** - * @brief - * The getDGSubMode function gets the current DG operating sub-mode. - * @details Inputs: dgSubMode - * @details Outputs: none - * @return Current DG operating sub-mode. - *************************************************************************/ -U32 getDGSubMode( void ) -{ - return dgSubMode; -} - -/*********************************************************************//** - * @brief - * The getDGActiveReservoir function gets the current active reservoir. - * @details Inputs: dgActiveReservoirSet - * @details Outputs: none - * @return Currently commanded active reservoir. - *************************************************************************/ -DG_RESERVOIR_ID_T getDGActiveReservoir( void ) -{ - return dgActiveReservoirSet; } /*********************************************************************//** * @brief + * The getDGOpMode function gets the current DG operating mode. + * @details Inputs: dgCurrentOpMode + * @details Outputs: none + * @return Current DG operating mode. + *************************************************************************/ +DG_OP_MODE_T getDGOpMode( void ) +{ + return dgCurrentOpMode; +} + +/*********************************************************************//** + * @brief + * The getDGSubMode function gets the current DG operating sub-mode. + * @details Inputs: dgSubMode + * @details Outputs: none + * @return Current DG operating sub-mode. + *************************************************************************/ +U32 getDGSubMode( void ) +{ + return dgSubMode; +} + +/*********************************************************************//** + * @brief + * The getDGActiveReservoir function gets the current active reservoir. + * @details Inputs: dgActiveReservoirSet + * @details Outputs: none + * @return Currently commanded active reservoir. + *************************************************************************/ +DG_RESERVOIR_ID_T getDGActiveReservoir( void ) +{ + return dgActiveReservoirSet; +} + +/*********************************************************************//** + * @brief * The getDGInactiveReservoir function gets the currently inactive reservoir. * @details Inputs: dgActiveReservoirSet * @details Outputs: none @@ -289,7 +295,7 @@ DG_RESERVOIR_ID_T inactiveRes = ( DG_RESERVOIR_2 == dgActiveReservoirSet ? DG_RESERVOIR_1 : DG_RESERVOIR_2 ); return inactiveRes; -} +} /*********************************************************************//** * @brief @@ -303,7 +309,7 @@ { return ( dgActiveReservoir == dgActiveReservoirSet ); } - + /*********************************************************************//** * @brief * The getDGDialysateFlowRateLMin function gets the latest dialysate flow @@ -317,7 +323,7 @@ F32 result = dgDialysateFlowRateMlMin; return result; -} +} /*********************************************************************//** * @brief @@ -462,75 +468,75 @@ return wt; } -/*********************************************************************//** - * @brief - * The setDGOpMode function sets the latest DG operating mode reported by - * the DG. - * @details Inputs: none - * @details Outputs: dgCurrentOpMode, dgSubMode - * @param opMode operating mode reported by DG - * @param subMode sub-mode (current state) of operating mode reported by DG - * @return none - *************************************************************************/ -void setDGOpMode( U32 opMode, U32 subMode ) +/*********************************************************************//** + * @brief + * The setDGOpMode function sets the latest DG operating mode reported by + * the DG. + * @details Inputs: none + * @details Outputs: dgCurrentOpMode, dgSubMode + * @param opMode operating mode reported by DG + * @param subMode sub-mode (current state) of operating mode reported by DG + * @return none + *************************************************************************/ +void setDGOpMode( U32 opMode, U32 subMode ) { - if ( opMode < NUM_OF_DG_MODES ) - { - dgCurrentOpMode = (DG_OP_MODE_T)opMode; - dgSubMode = subMode; - } - else - { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_DG_OPERATING_MODE, opMode ); + if ( opMode < NUM_OF_DG_MODES ) + { + dgCurrentOpMode = (DG_OP_MODE_T)opMode; + dgSubMode = subMode; } + else + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_DG_OPERATING_MODE, opMode ); + } - dgOpModeDataFreshFlag = TRUE; -} - -/*********************************************************************//** - * @brief - * The setDialysateTemperatureReadings function sets the latest dialysate - * temperatures reported by the DG. - * @details Inputs: none - * @details Outputs: dgDialysateTemp, dgRedundantDialysateTemp - * @param temp1 dialysate temperature reported by DG - * @param temp2 redundant dialysate temperature reported by DG - * @return none - *************************************************************************/ -void setDialysateTemperatureReadings( F32 temp1, F32 temp2 ) + dgOpModeDataFreshFlag = TRUE; +} + +/*********************************************************************//** + * @brief + * The setDialysateTemperatureReadings function sets the latest dialysate + * temperatures reported by the DG. + * @details Inputs: none + * @details Outputs: dgDialysateTemp, dgRedundantDialysateTemp + * @param temp1 dialysate temperature reported by DG + * @param temp2 redundant dialysate temperature reported by DG + * @return none + *************************************************************************/ +void setDialysateTemperatureReadings( F32 temp1, F32 temp2 ) { dgDialysateTemp = temp1; dgRedundantDialysateTemp = temp2; - dgDialysateTemperatureDataFreshFlag = TRUE; -} - -/*********************************************************************//** - * @brief - * The setDGReservoirsData function sets the latest reservoir data - * reported by the DG. - * @details Inputs: none - * @details Outputs: dgActiveReservoir, dgReservoirFillVolumeTarget, dgReservoirDrainVolumeTarget - * @param resID ID of active reservoir - * @param fillVol Reservoir fill to volume reported by DG - * @param drainVol Reservoir drain to volume reported by DG - * @return none - *************************************************************************/ -void setDGReservoirsData( DG_RESERVOIR_ID_T resID, U32 fillVol, U32 drainVol ) + dgDialysateTemperatureDataFreshFlag = TRUE; +} + +/*********************************************************************//** + * @brief + * The setDGReservoirsData function sets the latest reservoir data + * reported by the DG. + * @details Inputs: none + * @details Outputs: dgActiveReservoir, dgReservoirFillVolumeTarget, dgReservoirDrainVolumeTarget + * @param resID ID of active reservoir + * @param fillVol Reservoir fill to volume reported by DG + * @param drainVol Reservoir drain to volume reported by DG + * @return none + *************************************************************************/ +void setDGReservoirsData( DG_RESERVOIR_ID_T resID, U32 fillVol, U32 drainVol ) { - if ( resID < NUM_OF_DG_RESERVOIRS ) - { - dgActiveReservoir = resID; - dgReservoirFillVolumeTarget = fillVol; - dgReservoirDrainVolumeTarget = drainVol; - } - else + if ( resID < NUM_OF_DG_RESERVOIRS ) { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_HD_INVALID_RESERVOIR_ID, resID ); + dgActiveReservoir = resID; + dgReservoirFillVolumeTarget = fillVol; + dgReservoirDrainVolumeTarget = drainVol; } + else + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_HD_INVALID_RESERVOIR_ID, resID ); + } - dgReservoirsDataFreshFlag = TRUE; -} + dgReservoirsDataFreshFlag = TRUE; +} /*********************************************************************//** * @brief @@ -629,108 +635,108 @@ memcpy( &dgMixingRatios, &ratios, sizeof(DG_MIXING_RATIOS_T) ); } -/*********************************************************************//** - * @brief +/*********************************************************************//** + * @brief * The cmdSetDGDialysateHeatingParams function sends the dialysate heating - * parameters to DG. - * @details Inputs: none - * @details Outputs: dgTrimmerTempSet + * parameters to DG. + * @details Inputs: none + * @details Outputs: dgTrimmerTempSet * @param heatingParams Dialysate heating parameters to be sent to DG - * @return none - *************************************************************************/ -void cmdSetDGDialysateHeatingParams( DG_CMD_DIALYSATE_HEATING_PARAMS_T heatingParams ) -{ + * @return none + *************************************************************************/ +void cmdSetDGDialysateHeatingParams( DG_CMD_DIALYSATE_HEATING_PARAMS_T heatingParams ) +{ dgTrimmerTempSet = heatingParams.trimmerTargetTemperature; - // TODO what should we do with the BOOL return of this function? - sendDialysateHeatingParamsToDG( &heatingParams ); -} - -/*********************************************************************//** - * @brief - * The cmdStartDG function sends a start command to the DG. DG will transition - * from standby to recirculate mode and start producing warm, pure water. - * @details Inputs: none - * @details Outputs: start DG command sent - * @return none - *************************************************************************/ -void cmdStartDG( void ) -{ + // TODO what should we do with the BOOL return of this function? + sendDialysateHeatingParamsToDG( &heatingParams ); +} + +/*********************************************************************//** + * @brief + * The cmdStartDG function sends a start command to the DG. DG will transition + * from standby to recirculate mode and start producing warm, pure water. + * @details Inputs: none + * @details Outputs: start DG command sent + * @return none + *************************************************************************/ +void cmdStartDG( void ) +{ dgStartCommandSent = TRUE; - - sendDGStartStopCommand( (BOOL)START_DG_CMD ); -} - -/*********************************************************************//** - * @brief - * The cmdStopDG function sends a stop command to the DG. DG will transition - * from recirculate mode to standby mode. Pumps and heater go off. - * @details Inputs: none - * @details Outputs: stop DG command sent - * @return none - *************************************************************************/ -void cmdStopDG( void ) -{ + + sendDGStartStopCommand( (BOOL)START_DG_CMD ); +} + +/*********************************************************************//** + * @brief + * The cmdStopDG function sends a stop command to the DG. DG will transition + * from recirculate mode to standby mode. Pumps and heater go off. + * @details Inputs: none + * @details Outputs: stop DG command sent + * @return none + *************************************************************************/ +void cmdStopDG( void ) +{ dgStarted = FALSE; - - sendDGStartStopCommand( (BOOL)STOP_DG_CMD ); -} - -/*********************************************************************//** - * @brief - * The cmdStartDGTrimmerHeater function sends a start trimmer heater command - * to the DG. - * @details Inputs: none - * @details Outputs: start DG trimmer heater command sent - * @return none - *************************************************************************/ -void cmdStartDGTrimmerHeater( void ) -{ + + sendDGStartStopCommand( (BOOL)STOP_DG_CMD ); +} + +/*********************************************************************//** + * @brief + * The cmdStartDGTrimmerHeater function sends a start trimmer heater command + * to the DG. + * @details Inputs: none + * @details Outputs: start DG trimmer heater command sent + * @return none + *************************************************************************/ +void cmdStartDGTrimmerHeater( void ) +{ dgTrimmerHeaterOn = TRUE; dgCmdResp[ DG_CMD_START_TRIMMER_HEATER ].commandID = DG_CMD_NONE; - - sendDGStartStopTrimmerHeaterCommand( START_DG_CMD ); -} - -/*********************************************************************//** - * @brief - * The cmdStopDGTrimmerHeater function sends a stop trimmer heater command - * to the DG. - * @details Inputs: none - * @details Outputs: stop DG trimmer heater command sent - * @return none - *************************************************************************/ -void cmdStopDGTrimmerHeater( void ) -{ + + sendDGStartStopTrimmerHeaterCommand( START_DG_CMD ); +} + +/*********************************************************************//** + * @brief + * The cmdStopDGTrimmerHeater function sends a stop trimmer heater command + * to the DG. + * @details Inputs: none + * @details Outputs: stop DG trimmer heater command sent + * @return none + *************************************************************************/ +void cmdStopDGTrimmerHeater( void ) +{ dgTrimmerHeaterOn = FALSE; dgCmdResp[ DG_CMD_STOP_TRIMMER_HEATER ].commandID = DG_CMD_NONE; - sendDGStartStopTrimmerHeaterCommand( STOP_DG_CMD ); -} - -/*********************************************************************//** - * @brief - * The cmdSetDGActiveReservoir function sends a set active reservoir command - * message to the DG. - * @details Inputs: none - * @details Outputs: set active reservoir command sent to DG. - * @param resID ID of reservoir to set as active (reservoir for HD to draw from) - * @return none - *************************************************************************/ -void cmdSetDGActiveReservoir( DG_RESERVOIR_ID_T resID ) -{ - if ( resID < NUM_OF_DG_RESERVOIRS ) - { + sendDGStartStopTrimmerHeaterCommand( STOP_DG_CMD ); +} + +/*********************************************************************//** + * @brief + * The cmdSetDGActiveReservoir function sends a set active reservoir command + * message to the DG. + * @details Inputs: none + * @details Outputs: set active reservoir command sent to DG. + * @param resID ID of reservoir to set as active (reservoir for HD to draw from) + * @return none + *************************************************************************/ +void cmdSetDGActiveReservoir( DG_RESERVOIR_ID_T resID ) +{ + if ( resID < NUM_OF_DG_RESERVOIRS ) + { dgActiveReservoirSet = resID; dgCmdResp[ DG_CMD_SWITCH_RESERVOIR ].commandID = DG_CMD_NONE; - - sendDGSwitchReservoirCommand( (U32)resID ); - } - else - { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_HD_INVALID_RESERVOIR_ID, (U32)resID ); - } -} + sendDGSwitchReservoirCommand( (U32)resID ); + } + else + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_HD_INVALID_RESERVOIR_ID, (U32)resID ); + } +} + /*********************************************************************//** * @brief * The cmdChangeDGValveSetting function sends a change valve setting command @@ -753,24 +759,24 @@ SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_HD_INVALID_VALVE_SETTING_ID, (U32)valveSettingID ); } } - -/*********************************************************************//** - * @brief - * The cmdStartDGFill function sends a fill command message to the DG. - * @details Inputs: none - * @details Outputs: fill command sent to DG. + +/*********************************************************************//** + * @brief + * The cmdStartDGFill function sends a fill command message to the DG. + * @details Inputs: none + * @details Outputs: fill command sent to DG. * @param fillToVolMl volume (in mL) to fill inactive reservoir to - * @param targetFlowLPM target flow rate in L/min - * @return none - *************************************************************************/ -void cmdStartDGFill( U32 fillToVolMl, F32 targetFlowLPM ) + * @param targetFlowLPM target flow rate in L/min + * @return none + *************************************************************************/ +void cmdStartDGFill( U32 fillToVolMl, F32 targetFlowLPM ) { - dgCmdResp[ DG_CMD_START_FILL ].commandID = DG_CMD_NONE; + dgCmdResp[ DG_CMD_START_FILL ].commandID = DG_CMD_NONE; dgReservoirFillVolumeTargetSet = fillToVolMl; - - sendDGFillCommand( DG_CMD_START, fillToVolMl, targetFlowLPM ); -} + sendDGFillCommand( DG_CMD_START, fillToVolMl, targetFlowLPM ); +} + /*********************************************************************//** * @brief * The cmdStopDGFill function sends a fill command with stop parameter message to the DG. @@ -785,45 +791,45 @@ sendDGFillCommand( DG_CMD_STOP, 0, 0 ); } - -/*********************************************************************//** - * @brief - * The cmdStartDGDrain function sends a drain command message to the DG. - * @details Inputs: none + +/*********************************************************************//** + * @brief + * The cmdStartDGDrain function sends a drain command message to the DG. + * @details Inputs: none * @details Outputs: drain command sent to DG. * @param drainToVolMl volume (in mL) to drain inactive reservoir to * @param tareLoadCell flag to tell DG tare load cell or not - * @param start flag to tell DG to start or stop the drain mode - * @return none - *************************************************************************/ -void cmdStartDGDrain( U32 drainToVolMl, BOOL tareLoadCell, BOOL rinse, BOOL start ) + * @param start flag to tell DG to start or stop the drain mode + * @return none + *************************************************************************/ +void cmdStartDGDrain( U32 drainToVolMl, BOOL tareLoadCell, BOOL rinse, BOOL start ) { DRAIN_RESERVOIR_CMD_PAYLOAD_T payload; dgCmdResp[ DG_CMD_START_DRAIN ].commandID = DG_CMD_NONE; payload.drainToVolumeML = drainToVolMl; payload.tareLoadCells = tareLoadCell; payload.rinseConcentrateLines = rinse; - payload.cmd = start; + payload.cmd = start; dgReservoirDrainVolumeTargetSet = drainToVolMl; - - sendDGDrainCommand( &payload ); -} - -/*********************************************************************//** - * @brief - * The cmdDGSampleWater function sends a sample water command message to the DG. - * @details Inputs: none - * @details Outputs: sample water command sent to DG. - * @return none - *************************************************************************/ -void cmdDGSampleWater( SAMPLE_WATER_CMD_T cmd ) -{ - sendDGSampleWaterCommand( cmd ); + + sendDGDrainCommand( &payload ); } /*********************************************************************//** * @brief + * The cmdDGSampleWater function sends a sample water command message to the DG. + * @details Inputs: none + * @details Outputs: sample water command sent to DG. + * @return none + *************************************************************************/ +void cmdDGSampleWater( SAMPLE_WATER_CMD_T cmd ) +{ + sendDGSampleWaterCommand( cmd ); +} + +/*********************************************************************//** + * @brief * The cmdStartDGFlush function sends a start flush command message to * the DG. * @details Inputs: none @@ -900,7 +906,7 @@ dgCmdResp[ DG_CMD_START_CHEM_DISINFECT ].commandID = DG_CMD_NONE; sendDGStartChemicalDisinfectModeCommand( start ); -} +} /*********************************************************************//** * @brief @@ -1125,4 +1131,4 @@ return result; } -/**@}*/ +/**@}*/