Index: firmware/App/Controllers/DGInterface.c =================================================================== diff -u -r526e890e4e35fac0a622af538bf611ea15a30609 -r15eb1190709a5f0af5128c829b9917af7a928e3b --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 526e890e4e35fac0a622af538bf611ea15a30609) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 15eb1190709a5f0af5128c829b9917af7a928e3b) @@ -17,7 +17,7 @@ #include // To check for NaN -#include "Battery.h" +#include "CPLD.h" #include "DialInFlow.h" #include "Dialysis.h" #include "DGDefs.h" @@ -99,11 +99,6 @@ static DG_RESERVOIR_ID_T dgActiveReservoir; ///< Latest active reservoir reported by the DG. static DG_RESERVOIR_ID_T dgActiveReservoirSet; ///< Active reservoir 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. static HEATERS_DATA_T dgHeatersData; ///< DG heaters data. @@ -136,8 +131,6 @@ dgTrimmerTempCheckTimerCtr = 0; dgActiveReservoirSet = DG_RESERVOIR_1; dgActiveReservoir = DG_RESERVOIR_1; - dgReservoirFillVolumeTargetSet = 0; - dgReservoirDrainVolumeTargetSet = 0; dgDialysateTemp = 0.0F; dgCurrentOpMode = DG_MODE_INIT; dgSubMode = 0; @@ -234,7 +227,7 @@ *************************************************************************/ void execDGInterfaceMonitor( void ) { - if ( isACPowerLost() != TRUE ) + if ( getCPLDACPowerLossDetected() != TRUE ) { // 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 ); @@ -466,18 +459,31 @@ /*********************************************************************//** * @brief - * The getDialysateTemperature function gets the latest dialysate temperature. - * @details Inputs: dgDialysateTemp + * The getDGDisinfectsStates function returns the DG disinfects readings. + * @details Inputs: none * @details Outputs: none - * @return the current dialysate temperature + * @return the current DG disinfects readings *************************************************************************/ -F32 getDialysateTemperature( void ) +DG_DISINFECT_UI_STATES_T getDGDisinfectsStates( void ) { - return dgDialysateTemp; + return disinfectsStatus; } /*********************************************************************//** * @brief + * The getRedundantDialysateTemperature function gets the latest redundant + * dialysate temperature. + * @details Inputs: dgRedundantDialysateTemp + * @details Outputs: none + * @return the latest redundant dialysate temperature + *************************************************************************/ +F32 getRedundantDialysateTemperature( void ) +{ + return dgRedundantDialysateTemp; +} + +/*********************************************************************//** + * @brief * The getHeatDisinfectTemperatureSensorValue function gets the latest * heat disinfect temperature sensor value. * @details Inputs: dgDialysateTemp @@ -504,21 +510,21 @@ /*********************************************************************//** * @brief - * The getDGDisinfectsStates function returns the DG disinfects readings. - * @details Inputs: none + * The getDialysateTemperature function returns the DG dialysate temperature. + * @details Inputs: dgDialysateTemp * @details Outputs: none - * @return the current DG disinfects readings + * @return the latest dialysate temperature *************************************************************************/ -DG_DISINFECT_UI_STATES_T getDGDisinfectsStates( void ) +F32 getDialysateTemperature( void ) { - return disinfectsStatus; + return dgDialysateTemp; } /*********************************************************************//** * @brief * The getDGMixingRatios function returns the DG mixing ratios and the fill * prep time. - * @details Inputs: none + * @details Inputs: dgMixingRatios * @details Outputs: none * @return getDGMixingRatios which is the DG mixing ratios *************************************************************************/ @@ -598,8 +604,7 @@ * The setDGReservoirsData function sets the latest reservoir data * reported by the DG. * @details Inputs: none - * @details Outputs: dgActiveReservoir, dgReservoirFillVolumeTarget, - * dgReservoirDrainVolumeTarget, dgReservoirsDataFreshFlag + * @details Outputs: dgActiveReservoir, dgReservoirsDataFreshFlag * @param resID ID of active reservoir * @param fillVol Reservoir fill to volume reported by DG * @param drainVol Reservoir drain to volume reported by DG @@ -610,8 +615,6 @@ if ( resID < NUM_OF_DG_RESERVOIRS ) { dgActiveReservoir = resID; - dgReservoirFillVolumeTarget = fillVol; - dgReservoirDrainVolumeTarget = drainVol; } else { @@ -909,7 +912,6 @@ void cmdStartDGFill( U32 fillToVolMl, F32 targetFlowLPM ) { dgCmdResp[ DG_CMD_START_FILL ].commandID = DG_CMD_NONE; - dgReservoirFillVolumeTargetSet = fillToVolMl; sendDGFillCommand( DG_CMD_START, fillToVolMl, targetFlowLPM ); } @@ -924,7 +926,6 @@ void cmdStopDGFill( void ) { dgCmdResp[ DG_CMD_STOP_FILL ].commandID = DG_CMD_NONE; - dgReservoirFillVolumeTargetSet = 0; sendDGFillCommand( DG_CMD_STOP, 0, 0 ); } @@ -948,7 +949,6 @@ payload.tareLoadCells = tareLoadCell; payload.rinseConcentrateLines = rinse; payload.cmd = start; - dgReservoirDrainVolumeTargetSet = drainToVolMl; sendDGDrainCommand( &payload ); } @@ -1311,7 +1311,7 @@ U32 trimmerState = dgHeatersData.trimmerHeaterState; DG_OP_MODE_T dgOp = getDGOpMode(); - if ( isACPowerLost() != TRUE ) + if ( getCPLDACPowerLossDetected() != TRUE ) { if ( ( DG_MODE_GENE == dgOp ) || ( DG_MODE_FILL == dgOp ) || ( DG_MODE_DRAI == dgOp ) ) {