Index: firmware/App/Controllers/DGInterface.c =================================================================== diff -u -rb32dd9e582f74d0ddc106a0d0b1efa8974c08c4d -r2f2419f67d9d458837893fef5cc1b21870021026 --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision b32dd9e582f74d0ddc106a0d0b1efa8974c08c4d) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 2f2419f67d9d458837893fef5cc1b21870021026) @@ -824,8 +824,22 @@ { dgCmdResp[ DG_CMD_START_FILL ].commandID = DG_CMD_NONE; dgReservoirFillVolumeTargetSet = fillToVolMl; - sendDGFillCommand( fillToVolMl ); + sendDGFillCommand( DG_CMD_START, fillToVolMl ); } + +/*********************************************************************//** + * @brief + * The cmdStopDGFill function sends a fill command with stop parameter message to the DG. + * @details Inputs: none + * @details Outputs: fill command with stop parameter sent to DG. + * @return none + *************************************************************************/ +void cmdStopDGFill( void ) +{ + dgCmdResp[ DG_CMD_STOP_FILL ].commandID = DG_CMD_NONE; + dgReservoirFillVolumeTargetSet = 0; + sendDGFillCommand( DG_CMD_STOP, 0 ); +} /*********************************************************************//** * @brief Index: firmware/App/Controllers/DGInterface.h =================================================================== diff -u -rb32dd9e582f74d0ddc106a0d0b1efa8974c08c4d -r2f2419f67d9d458837893fef5cc1b21870021026 --- firmware/App/Controllers/DGInterface.h (.../DGInterface.h) (revision b32dd9e582f74d0ddc106a0d0b1efa8974c08c4d) +++ firmware/App/Controllers/DGInterface.h (.../DGInterface.h) (revision 2f2419f67d9d458837893fef5cc1b21870021026) @@ -148,7 +148,8 @@ void cmdStopDG( void ); void cmdSetDGActiveReservoir( DG_RESERVOIR_ID_T resID ); void cmdChangeDGValveSetting( DG_VALVE_SETTING_ID_T valveSettingID ); -void cmdStartDGFill( U32 fillToVolMl ); +void cmdStartDGFill( U32 fillToVolMl ); +void cmdStopDGFill( void ); void cmdStartDGDrain( U32 drainToVolMl, BOOL tareLoadCell ); void cmdStartDGTrimmerHeater( void ); void cmdStopDGTrimmerHeater( void ); Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -red962b050e6b9714318a0b9034742efc2ccb9e4f -r2f2419f67d9d458837893fef5cc1b21870021026 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision ed962b050e6b9714318a0b9034742efc2ccb9e4f) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 2f2419f67d9d458837893fef5cc1b21870021026) @@ -781,11 +781,12 @@ * The sendDGFillCommand function constructs a DG fill command message * and queues the msg for transmit on the appropriate CAN channel. * @details Inputs: none - * @details Outputs: DG fill command msg constructed and queued. + * @details Outputs: DG fill command msg constructed and queued. + * @param cmd start or stop fill command * @param fillToVolumeMl volume (in mL) to fill inactive reservoir to * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ -BOOL sendDGFillCommand( U32 fillToVolumeMl ) +BOOL sendDGFillCommand( U32 cmd, U32 fillToVolumeMl ) { BOOL result; MESSAGE_T msg; @@ -794,10 +795,12 @@ // Create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_DG_FILL_CMD; - msg.hdr.payloadLen = sizeof( U32 ); + msg.hdr.payloadLen = sizeof( U32 ) + sizeof( U32 ); + + memcpy( payloadPtr, &fillToVolumeMl, sizeof( U32 ) ); + payloadPtr += sizeof( U32 ); + memcpy( payloadPtr, &cmd, sizeof( U32 ) ); - memcpy( payloadPtr, &fillToVolumeMl, sizeof( U32 ) ); - // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer result = serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_DG, ACK_REQUIRED ); Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -red962b050e6b9714318a0b9034742efc2ccb9e4f -r2f2419f67d9d458837893fef5cc1b21870021026 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision ed962b050e6b9714318a0b9034742efc2ccb9e4f) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 2f2419f67d9d458837893fef5cc1b21870021026) @@ -200,7 +200,7 @@ BOOL sendDGChangeValveSettingCommand( U32 valveSettingCmd ); // MSG_ID_DG_FILL_CMD -BOOL sendDGFillCommand( U32 fillToVolumeMl ); +BOOL sendDGFillCommand( U32 cmd, U32 fillToVolumeMl ); // MSG_ID_DG_DRAIN_CMD BOOL sendDGDrainCommand( DRAIN_RESERVOIR_CMD_PAYLOAD_T *drainCmdPtr );