Index: firmware/App/Services/Reservoirs.c =================================================================== diff -u -r484b185f0cf4b2ea0ba9de331573952b1b5124b4 -r67021fbc633259e8e1bce76749dbef7d0cb51998 --- firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 484b185f0cf4b2ea0ba9de331573952b1b5124b4) +++ firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 67021fbc633259e8e1bce76749dbef7d0cb51998) @@ -14,14 +14,14 @@ * @date (original) 18-Mar-2020 * ***************************************************************************/ - -#include // for memcpy() -#include "LoadCell.h" -#include "ModeRecirculate.h" -#include "OperationModes.h" -#include "Reservoirs.h" -#include "SystemCommMessages.h" +#include // for memcpy() + +#include "LoadCell.h" +#include "ModeRecirculate.h" +#include "OperationModes.h" +#include "Reservoirs.h" +#include "SystemCommMessages.h" #include "TaskGeneral.h" #include "Timers.h" #include "Valves.h" @@ -36,9 +36,8 @@ #define MIN_RESERVOIR_VOLUME_ML 0 ///< Minimum reservoir volume in mL. #define MAX_RESERVOIR_VOLUME_ML 2000 ///< Maximum reservoir volume in mL. #define DEFAULT_FILL_VOLUME_ML 1700 ///< Default fill volume for treatment in mL. -#define DISINFECT_FILL_VOLUME_ML 2400 ///< Fill volume for disinfection in mL. #define MAX_FILL_VOLUME_ML MAX_RESERVOIR_VOLUME_ML ///< Maximum fill volume in mL. -#define DEFAULT_DRAIN_VOLUME_ML 100 ///< Default drain volume in mL. +#define DEFAULT_DRAIN_VOLUME_ML 0 ///< Default drain volume in mL. #define MAX_DRAIN_VOLUME_ML MAX_RESERVOIR_VOLUME_ML ///< Maximum drain volume in mL. #define MAX_RESERVOIR_WEIGHT 10000 ///< Maximum reservoir weight in grams. @@ -51,6 +50,7 @@ static OVERRIDE_U32_T activeReservoir = { 0, 0, 0, 0 }; ///< The active reservoir that the DG is filling/draining/etc. static OVERRIDE_U32_T fillVolumeTargetMl = { 0, 0, 0, 0 }; ///< The target reservoir fill volume (in mL). + static OVERRIDE_U32_T drainVolumeTargetMl = { 0, 0, 0, 0 }; ///< The target reservoir drain volume (in mL). /// The reservoirs' associate load cell. @@ -62,12 +62,15 @@ static F32 reservoirLowestWeight[ NUM_OF_DG_RESERVOIRS ] = { MAX_RESERVOIR_WEIGHT, MAX_RESERVOIR_WEIGHT }; static U32 reservoirWeightUnchangeStartTime[ NUM_OF_DG_RESERVOIRS ] = { 0, 0 }; ///< The reservoirs' weight start time when weight stop decreasing. static BOOL tareLoadCellRequest; ///< Flag indicates if load cell tare has been requested by HD. - +static DG_RESERVOIR_VOLUME_RECORD_T reservoirsCalRecord; ///< DG reservoirs non-volatile record. + // ********** private function prototypes ********** static DG_RESERVOIR_ID_T getActiveReservoir( void ); static U32 getReservoirFillVolumeTargetMl( void ); -static U32 getReservoirDrainVolumeTargetMl( void ); + +static U32 getReservoirDrainVolumeTargetMl( void ); +static BOOL processCalibrationData( void ); /*********************************************************************//** * @brief @@ -77,12 +80,8 @@ * @return none *************************************************************************/ void initReservoirs( void ) -{ - activeReservoir.data = DG_RESERVOIR_2; - setValveState( VRF, VALVE_STATE_R1_C_TO_NC ); - setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); - setValveState( VRO, VALVE_STATE_R2_C_TO_NC ); - setValveState( VRI, VALVE_STATE_R2_C_TO_NC ); +{ + activeReservoir.data = (U32)DG_RESERVOIR_1; fillVolumeTargetMl.data = DEFAULT_FILL_VOLUME_ML; drainVolumeTargetMl.data = DEFAULT_DRAIN_VOLUME_ML; } @@ -95,7 +94,14 @@ * @return none *************************************************************************/ void execReservoirs( void ) -{ +{ + // Check if a new calibration is available + if ( TRUE == isNewCalibrationRecordAvailable() ) + { + // Get the new calibration data and check its validity + processCalibrationData(); + } + // publish active reservoir, fill/drain volume targets at 1 Hz. if ( ++reservoirDataPublicationTimerCounter >= RESERVOIR_DATA_PUB_INTERVAL ) { @@ -105,6 +111,31 @@ broadcastReservoirData( actRes, filVol, drnVol ); reservoirDataPublicationTimerCounter = 0; } +} + +/*********************************************************************//** + * @brief + * The execDrainPumpSelfTest function executes the drain pump's self-test. + * @details Inputs: none + * @details Outputs: none + * @return PressuresSelfTestResult (SELF_TEST_STATUS_T) + *************************************************************************/ +SELF_TEST_STATUS_T execReservoirsSelfTest( void ) +{ + SELF_TEST_STATUS_T result = SELF_TEST_STATUS_IN_PROGRESS; + + BOOL calStatus = processCalibrationData(); + + if ( TRUE == calStatus ) + { + result = SELF_TEST_STATUS_PASSED; + } + else + { + result = SELF_TEST_STATUS_FAILED; + } + + return result; } /*********************************************************************//** @@ -123,17 +154,21 @@ cmdResponse.commandID = DG_CMD_SWITCH_RESERVOIR; cmdResponse.rejected = TRUE; cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_NONE; - - // switch reservoir command only valid in re-circulate mode - if ( DG_MODE_CIRC == getCurrentOperationMode() ) - { - switch ( resID ) - { - case DG_RESERVOIR_1: + + // switch reservoir command only valid in re-circulate mode + if ( DG_MODE_CIRC == getCurrentOperationMode() ) + { + switch ( resID ) + { + case DG_RESERVOIR_1: activeReservoir.data = (U32)resID; cmdResponse.rejected = FALSE; setValveState( VRF, VALVE_STATE_R2_C_TO_NO ); - setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); +#ifndef V_2_SYSTEM + setValveState( VRD1, VALVE_STATE_CLOSED ); +#else + setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); +#endif setValveState( VRO, VALVE_STATE_R1_C_TO_NO ); setValveState( VRI, VALVE_STATE_R1_C_TO_NO ); break; @@ -142,24 +177,28 @@ activeReservoir.data = (U32)resID; cmdResponse.rejected = FALSE; setValveState( VRF, VALVE_STATE_R1_C_TO_NC ); - setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); +#ifndef V_2_SYSTEM + setValveState( VRD2, VALVE_STATE_CLOSED ); +#else + setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); +#endif setValveState( VRO, VALVE_STATE_R2_C_TO_NC ); setValveState( VRI, VALVE_STATE_R2_C_TO_NC ); break; default: // invalid reservoir given - cmd will be NAK'd w/ false result. - cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_INVALID_PARAMETER; - break; - } + cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_INVALID_PARAMETER; + break; + } } else { cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_INVALID_MODE; - } + } sendCommandResponseMsg( &cmdResponse ); -} +} /*********************************************************************//** * @brief @@ -208,149 +247,174 @@ sendCommandResponseMsg( &cmdResponse ); } - -/*********************************************************************//** - * @brief - * The startFillCmd function handles a fill command from the HD. - * @details Inputs: none - * @details Outputs: move to fill mode - * @param fillToVolMl Target volume (in mL) to fill reservoir to - * @return none - *************************************************************************/ -void startFillCmd( U32 fillToVolMl ) -{ + +/*********************************************************************//** + * @brief + * The startFillCmd function handles a fill command from the HD. + * @details Inputs: none + * @details Outputs: move to fill mode + * @param fillToVolMl Target volume (in mL) to fill reservoir to + * @return none + *************************************************************************/ +void startFillCmd( U32 fillToVolMl ) +{ DG_CMD_RESPONSE_T cmdResponse; cmdResponse.commandID = DG_CMD_START_FILL; cmdResponse.rejected = TRUE; - cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_NONE; - - // fill command only valid in re-circulate mode - if ( ( DG_MODE_CIRC == getCurrentOperationMode() ) && - ( DG_RECIRCULATE_MODE_STATE_RECIRC_WATER == getCurrentRecirculateState() ) ) - { - // validate parameters - if ( fillToVolMl < MAX_FILL_VOLUME_ML ) - { - fillVolumeTargetMl.data = fillToVolMl; - requestNewOperationMode( DG_MODE_FILL ); - cmdResponse.rejected = FALSE; + cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_NONE; + + // fill command only valid in re-circulate mode + if ( ( DG_MODE_CIRC == getCurrentOperationMode() ) && ( DG_RECIRCULATE_MODE_STATE_RECIRC_WATER == getCurrentRecirculateState() ) ) + { + // validate parameters + if ( fillToVolMl < MAX_FILL_VOLUME_ML ) + { + fillVolumeTargetMl.data = fillToVolMl; + requestNewOperationMode( DG_MODE_FILL ); + cmdResponse.rejected = FALSE; } else { cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_INVALID_PARAMETER; - } + } } else { cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_INVALID_MODE; - } + } - sendCommandResponseMsg( &cmdResponse ); -} - -/*********************************************************************//** - * @brief - * The stopFillCmd function handles a stop fill command from the HD. - * @details Inputs: none - * @details Outputs: move to re-circulate mode - * @return none - *************************************************************************/ -void stopFillCmd( void ) -{ + sendCommandResponseMsg( &cmdResponse ); +} + +/*********************************************************************//** + * @brief + * The stopFillCmd function handles a stop fill command from the HD. + * @details Inputs: none + * @details Outputs: move to re-circulate mode + * @return none + *************************************************************************/ +void stopFillCmd( void ) +{ DG_CMD_RESPONSE_T cmdResponse; cmdResponse.commandID = DG_CMD_STOP_FILL; cmdResponse.rejected = TRUE; cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_NONE; - - // stop fill command only valid in fill mode - if ( DG_MODE_FILL == getCurrentOperationMode() ) - { - fillVolumeTargetMl.data = 0; - requestNewOperationMode( DG_MODE_CIRC ); - cmdResponse.rejected = FALSE; + + // stop fill command only valid in fill mode + if ( DG_MODE_FILL == getCurrentOperationMode() ) + { + fillVolumeTargetMl.data = 0; + requestNewOperationMode( DG_MODE_CIRC ); + cmdResponse.rejected = FALSE; } else { cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_INVALID_MODE; - } - - sendCommandResponseMsg( &cmdResponse ); -} - -/*********************************************************************//** - * @brief - * The startDrainCmd function handles a drain command from the HD. - * @details Inputs: none - * @details Outputs: Start draining in re-circulate mode - * @param drainCmd drain command data record - * @return none - *************************************************************************/ -void startDrainCmd( DRAIN_CMD_T drainCmd ) -{ + } + + sendCommandResponseMsg( &cmdResponse ); +} + +/*********************************************************************//** + * @brief + * The startDrainCmd function handles a drain command from the HD. + * @details Inputs: none + * @details Outputs: Start draining in re-circulate mode + * @param drainCmd drain command data record + * @return none + *************************************************************************/ +void startDrainCmd( DRAIN_CMD_T drainCmd ) +{ DG_CMD_RESPONSE_T cmdResponse; cmdResponse.commandID = DG_CMD_START_DRAIN; cmdResponse.rejected = TRUE; - cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_NONE; - - // drain command only valid in re-circulate mode - if ( DG_MODE_CIRC == getCurrentOperationMode() ) - { - // validate parameters - if ( drainCmd.targetVolume <= MAX_DRAIN_VOLUME_ML ) - { + cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_NONE; + + // drain command only valid in re-circulate mode + if ( DG_MODE_CIRC == getCurrentOperationMode() ) + { + // validate parameters + if ( drainCmd.targetVolume <= MAX_DRAIN_VOLUME_ML ) + { drainVolumeTargetMl.data = drainCmd.targetVolume; - tareLoadCellRequest = drainCmd.tareLoadCell; - requestNewOperationMode( DG_MODE_DRAI ); - cmdResponse.rejected = FALSE; + tareLoadCellRequest = drainCmd.tareLoadCell; + requestNewOperationMode( DG_MODE_DRAI ); + cmdResponse.rejected = FALSE; } else { cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_INVALID_PARAMETER; - } + } } else { cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_INVALID_MODE; - } - - sendCommandResponseMsg( &cmdResponse ); -} - -/*********************************************************************//** - * @brief - * The stopDrainCmd function handles a stop drain command from the HD. - * @details Inputs: none - * @details Outputs: move to re-circulate mode - * @return none - *************************************************************************/ -void stopDrainCmd( void ) -{ + } + + sendCommandResponseMsg( &cmdResponse ); +} + +/*********************************************************************//** + * @brief + * The stopDrainCmd function handles a stop drain command from the HD. + * @details Inputs: none + * @details Outputs: move to re-circulate mode + * @return none + *************************************************************************/ +void stopDrainCmd( void ) +{ DG_CMD_RESPONSE_T cmdResponse; cmdResponse.commandID = DG_CMD_STOP_DRAIN; cmdResponse.rejected = TRUE; - cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_NONE; - - // stop drain command only valid in drain mode - if ( DG_MODE_DRAI == getCurrentOperationMode() ) - { - drainVolumeTargetMl.data = 0; - requestNewOperationMode( DG_MODE_CIRC ); - cmdResponse.rejected = FALSE; - } + cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_NONE; + + // stop drain command only valid in drain mode + if ( DG_MODE_DRAI == getCurrentOperationMode() ) + { + drainVolumeTargetMl.data = 0; + requestNewOperationMode( DG_MODE_CIRC ); + cmdResponse.rejected = FALSE; + } else { cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_INVALID_MODE; } - - sendCommandResponseMsg( &cmdResponse ); -} + sendCommandResponseMsg( &cmdResponse ); +} + /*********************************************************************//** * @brief + * The tareReservoir function sets the tare load cell variable to TRUE. + * @details Inputs: none + * @details Outputs: none + * @return none + *************************************************************************/ +void tareReservoir( void ) +{ + tareLoadCellRequest = TRUE; +} + +/*********************************************************************//** + * @brief + * The resetReservoirsLowestWeight function resets the lowest load cell + * weight of the reservoirs. + * @details Inputs: reservoirLowestWeight + * @details Outputs: reservoirLowestWeight + * @return none + *************************************************************************/ +void resetReservoirsLowestWeight( void ) +{ + reservoirLowestWeight[ DG_RESERVOIR_1 ] = MAX_RESERVOIR_WEIGHT; + reservoirLowestWeight[ DG_RESERVOIR_2 ] = MAX_RESERVOIR_WEIGHT; +} + +/*********************************************************************//** + * @brief * The getInactiveReservoir function gets the inactive reservoir. * @details Inputs: activeReservoir * @details Outputs: none @@ -384,6 +448,19 @@ /*********************************************************************//** * @brief + * The getReservoirsCalRecord function returns the reservoirs' calibration + * record. + * @details Inputs: reservoirsCalRecord + * @details Outputs: none + * @return reservoirs' calibration record + *************************************************************************/ +DG_RESERVOIR_VOLUME_RECORD_T getReservoirsCalRecord( void ) +{ + return reservoirsCalRecord; +} + +/*********************************************************************//** + * @brief * The hasTargetFillVolumeReached function checks if the target fill volume * for specific reservoir has been reached. * @details Inputs: fillVolumeTargetMl @@ -413,6 +490,7 @@ BOOL hasTargetDrainVolumeBeenReached( DG_RESERVOIR_ID_T reservoirId, U32 timeout ) { BOOL result = FALSE; + F32 const loadcellWeight = getLoadCellSmallFilteredWeight( associatedLoadCell[ reservoirId ] ); U32 const targetDrainVolume = getReservoirDrainVolumeTargetMl(); @@ -425,12 +503,15 @@ BOOL const hasTimeOut = didTimeout( reservoirWeightUnchangeStartTime[ reservoirId ], timeout ); BOOL const hasTargetReached = ( targetDrainVolume >= loadcellWeight ); - if ( hasTimeOut || hasTargetReached ) + // If the goal is to tare the load cell, then the target drain should be reached and timing out on the + // reservoir weight is not enough + if ( ( TRUE == hasTimeOut ) || ( ( TRUE == hasTargetReached ) && ( FALSE == tareLoadCellRequest ) ) ) { result = TRUE; + // Reset for next drain reservoirLowestWeight[ reservoirId ] = MAX_RESERVOIR_WEIGHT; - if ( tareLoadCellRequest ) + if ( TRUE == tareLoadCellRequest ) { tareLoadCellRequest = FALSE; tareLoadCell( associatedLoadCell[ reservoirId ] ); @@ -443,21 +524,38 @@ /*********************************************************************//** * @brief - * The resetReservoirLoadCellsOffset function sets the reservoir's load cells - * offset to zero. - * @details Inputs: associateLoadCell[], redundantLoadCell[] - * @details Outputs: reset reservoir's associate load cells auto calibration offset - * @param reservoirId reservoir id + * The tareLoadCellsAtEmpty function tares the load cells for the given + * reservoir when empty and tare request is pending. + * @details Inputs: tareLoadCellRequest + * @details Outputs: tareLoadCellRequest + * @param reservoirId ID of reservoir to tare * @return none *************************************************************************/ -void resetReservoirLoadCellsOffset( DG_RESERVOIR_ID_T reservoirId ) +void tareLoadCellsAtEmpty( DG_RESERVOIR_ID_T reservoirId ) { - resetLoadCellOffset( associatedLoadCell[ reservoirId ] ); - resetLoadCellOffset( redundantLoadCell[ reservoirId ] ); + if ( TRUE == tareLoadCellRequest ) + { + tareLoadCellRequest = FALSE; + tareLoadCell( associatedLoadCell[ reservoirId ] ); + tareLoadCell( redundantLoadCell[ reservoirId ] ); + } } /*********************************************************************//** * @brief + * The isReservoirTarePending function determines whether a reservoir tare + * request is currently pending. + * @details Inputs: tareLoadCellRequest + * @details Outputs: none + * @return tareLoadCellRequest + *************************************************************************/ +BOOL isReservoirTarePending( void ) +{ + return tareLoadCellRequest; +} + +/*********************************************************************//** + * @brief * The getActiveReservoir function gets the active reservoir. * @details Inputs: activeReservoir * @details Outputs: none @@ -513,143 +611,183 @@ return result; } +/*********************************************************************//** + * @brief + * The processCalibrationData function gets the calibration data and makes + * sure it is valid by checking the calibration date. The calibration date + * should not be 0. + * @details Inputs: none + * @details Outputs: reservoirsCalRecord + * @return TRUE if the calibration record is valid, otherwise FALSE + *************************************************************************/ +static BOOL processCalibrationData( void ) +{ + BOOL status = TRUE; + U32 reservoir; -/************************************************************************* - * TEST SUPPORT FUNCTIONS - *************************************************************************/ + // Get the calibration record from NVDataMgmt + DG_RESERVOIR_VOLUME_RECORD_T calData = getDGReservoirsVolumeRecord(); - -/*********************************************************************//** - * @brief - * The testSetDGActiveReservoirOverride function overrides the active reservoir. - * @details Inputs: activeReservoir - * @details Outputs: activeReservoir - * @param value override active reservoir ID - * @return TRUE if override successful, FALSE if not - *************************************************************************/ -BOOL testSetDGActiveReservoirOverride( DG_RESERVOIR_ID_T value ) -{ - BOOL result = FALSE; - - if ( TRUE == isTestingActivated() ) - { - result = TRUE; - activeReservoir.ovData = value; - activeReservoir.override = OVERRIDE_KEY; - } - - return result; -} - -/*********************************************************************//** - * @brief - * The activeReservoir function resets the override of the active reservoir. - * @details Inputs: activeReservoir - * @details Outputs: activeReservoir - * @return TRUE if override reset successful, FALSE if not - *************************************************************************/ -BOOL testResetDGActiveReservoirOverride( void ) -{ - BOOL result = FALSE; - - if ( TRUE == isTestingActivated() ) - { - result = TRUE; - activeReservoir.override = OVERRIDE_RESET; - activeReservoir.ovData = activeReservoir.ovInitData; - } - - return result; -} - -/*********************************************************************//** - * @brief - * The testSetReservoirFillVolumeMlOverride function overrides the target - * reservoir fill volume (in mL). - * @details Inputs: fillVolumeTargetMl - * @details Outputs: fillVolumeTargetMl - * @param value override target reservoir fill volume (in mL) - * @return TRUE if override successful, FALSE if not - *************************************************************************/ -BOOL testSetReservoirFillVolumeMlOverride( U32 value ) -{ - BOOL result = FALSE; - - if ( TRUE == isTestingActivated() ) - { - result = TRUE; - fillVolumeTargetMl.ovData = value; - fillVolumeTargetMl.override = OVERRIDE_KEY; - } - - return result; -} - -/*********************************************************************//** - * @brief + for ( reservoir = 0; reservoir < NUM_OF_CAL_DATA_RSRVRS; reservoir++ ) + { +#ifndef SKIP_CAL_CHECK + // Check if the calibration data that was received from NVDataMgmt is legitimate + // The calibration date item should not be zero. If the calibration date is 0, + // then the data is not stored in the NV memory or it was corrupted. + if ( 0 == calData.reservoir[ reservoir ].calibrationTime ) + { + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_RESERVOIRS_INVALID_CAL_RECORD, (U32)reservoir ); + status = FALSE; + } +#endif + + // The calibration data was valid, update the local copy + reservoirsCalRecord.reservoir[ reservoir ].maxResidualFluid = calData.reservoir[ reservoir ].maxResidualFluid; + reservoirsCalRecord.reservoir[ reservoir ].normalFillVolume = calData.reservoir[ reservoir ].normalFillVolume; + reservoirsCalRecord.reservoir[ reservoir ].rsrvrUnfilledWeight = calData.reservoir[ reservoir ].rsrvrUnfilledWeight; + reservoirsCalRecord.reservoir[ reservoir ].rsrvrVolume = calData.reservoir[ reservoir ].rsrvrVolume; + } + + return status; +} + + +/************************************************************************* + * TEST SUPPORT FUNCTIONS + *************************************************************************/ + + +/*********************************************************************//** + * @brief + * The testSetDGActiveReservoirOverride function overrides the active reservoir. + * @details Inputs: activeReservoir + * @details Outputs: activeReservoir + * @param value override active reservoir ID + * @return TRUE if override successful, FALSE if not + *************************************************************************/ +BOOL testSetDGActiveReservoirOverride( DG_RESERVOIR_ID_T value ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + activeReservoir.ovData = value; + activeReservoir.override = OVERRIDE_KEY; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The activeReservoir function resets the override of the active reservoir. + * @details Inputs: activeReservoir + * @details Outputs: activeReservoir + * @return TRUE if override reset successful, FALSE if not + *************************************************************************/ +BOOL testResetDGActiveReservoirOverride( void ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + activeReservoir.override = OVERRIDE_RESET; + activeReservoir.ovData = activeReservoir.ovInitData; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testSetReservoirFillVolumeMlOverride function overrides the target + * reservoir fill volume (in mL). + * @details Inputs: fillVolumeTargetMl + * @details Outputs: fillVolumeTargetMl + * @param value override target reservoir fill volume (in mL) + * @return TRUE if override successful, FALSE if not + *************************************************************************/ +BOOL testSetReservoirFillVolumeMlOverride( U32 value ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + fillVolumeTargetMl.ovData = value; + fillVolumeTargetMl.override = OVERRIDE_KEY; + } + + return result; +} + +/*********************************************************************//** + * @brief * The testResetReservoirFillVolumeMlOverride function resets the override of - * the target reservoir fill volume. - * @details Inputs: fillVolumeTargetMl - * @details Outputs: fillVolumeTargetMl - * @return TRUE if override reset successful, FALSE if not - *************************************************************************/ -BOOL testResetReservoirFillVolumeMlOverride( void ) -{ - BOOL result = FALSE; - - if ( TRUE == isTestingActivated() ) - { - result = TRUE; - fillVolumeTargetMl.override = OVERRIDE_RESET; - fillVolumeTargetMl.ovData = fillVolumeTargetMl.ovInitData; - } - - return result; -} - -/*********************************************************************//** - * @brief - * The testSetReservoirDrainVolumeMlOverride function overrides the target - * reservoir drain volume (in mL). - * @details Inputs: drainVolumeTargetMl - * @details Outputs: drainVolumeTargetMl - * @param value override target reservoir drain volume (in mL) - * @return TRUE if override successful, FALSE if not - *************************************************************************/ -BOOL testSetReservoirDrainVolumeMlOverride( U32 value ) -{ - BOOL result = FALSE; - - if ( TRUE == isTestingActivated() ) - { - result = TRUE; - drainVolumeTargetMl.ovData = value; - drainVolumeTargetMl.override = OVERRIDE_KEY; - } - - return result; -} - -/*********************************************************************//** - * @brief + * the target reservoir fill volume. + * @details Inputs: fillVolumeTargetMl + * @details Outputs: fillVolumeTargetMl + * @return TRUE if override reset successful, FALSE if not + *************************************************************************/ +BOOL testResetReservoirFillVolumeMlOverride( void ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + fillVolumeTargetMl.override = OVERRIDE_RESET; + fillVolumeTargetMl.ovData = fillVolumeTargetMl.ovInitData; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testSetReservoirDrainVolumeMlOverride function overrides the target + * reservoir drain volume (in mL). + * @details Inputs: drainVolumeTargetMl + * @details Outputs: drainVolumeTargetMl + * @param value override target reservoir drain volume (in mL) + * @return TRUE if override successful, FALSE if not + *************************************************************************/ +BOOL testSetReservoirDrainVolumeMlOverride( U32 value ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + drainVolumeTargetMl.ovData = value; + drainVolumeTargetMl.override = OVERRIDE_KEY; + } + + return result; +} + +/*********************************************************************//** + * @brief * The testResetReservoirDrainVolumeMlOverride function resets the override of - * the target reservoir drain volume. - * @details Inputs: drainVolumeTargetMl - * @details Outputs: drainVolumeTargetMl - * @return TRUE if override reset successful, FALSE if not - *************************************************************************/ -BOOL testResetReservoirDrainVolumeMlOverride( void ) -{ - BOOL result = FALSE; - - if ( TRUE == isTestingActivated() ) - { - result = TRUE; - drainVolumeTargetMl.override = OVERRIDE_RESET; - drainVolumeTargetMl.ovData = drainVolumeTargetMl.ovInitData; - } - - return result; -} - -/**@}*/ + * the target reservoir drain volume. + * @details Inputs: drainVolumeTargetMl + * @details Outputs: drainVolumeTargetMl + * @return TRUE if override reset successful, FALSE if not + *************************************************************************/ +BOOL testResetReservoirDrainVolumeMlOverride( void ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + drainVolumeTargetMl.override = OVERRIDE_RESET; + drainVolumeTargetMl.ovData = drainVolumeTargetMl.ovInitData; + } + + return result; +} + +/**@}*/