Index: firmware/App/Controllers/ConcentratePumps.c =================================================================== diff -u -r8fe65bf6222137cc7182ccacff3a5f2fb2f03753 -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision 8fe65bf6222137cc7182ccacff3a5f2fb2f03753) +++ firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -173,7 +173,6 @@ if ( ++concentratePumpMonitorTimerCounter >= getU32OverrideValue( &concentratePumpDataPublishInterval ) ) { CONCENTRATE_PUMP_DATA_T data; - U08 fpgaConcentratePumpsFault = getFPGAConcentratePumpsFault(); if ( 0 != fpgaConcentratePumpsFault ) @@ -626,7 +625,7 @@ } else { - // Clear the alarm + // Clear the alarm condition checkPersistentAlarm( ALARM_ID_DG_CONC_PUMP_HALL_SENSOR_OUT_OF_RANGE, FALSE, 0, CONCENTRATE_PUMP_MIN_ALLOWED_HALL_SENSOR_COUNT ); } Index: firmware/App/Controllers/ConcentratePumps.h =================================================================== diff -u -r3414e47b2664c56ab6b2f0cd5cd6b30ae9a5e333 -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Controllers/ConcentratePumps.h (.../ConcentratePumps.h) (revision 3414e47b2664c56ab6b2f0cd5cd6b30ae9a5e333) +++ firmware/App/Controllers/ConcentratePumps.h (.../ConcentratePumps.h) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -50,8 +50,8 @@ F32 cp2MeasuredSpeed; ///< Concentrate pump CP2 measured speed U32 cp1State; ///< Concentrate pump CP1 current state U32 cp2State; ///< Concentrate pump CP2 current state - F32 cp1PulseInSeconds; - F32 cp2PulseInSeconds; + F32 cp1PulseInSeconds; ///< Concentrate pump CP1 pulse in seconds + F32 cp2PulseInSeconds; ///< Concentrate pump CP2 pulse in seconds } CONCENTRATE_PUMP_DATA_T; // ********** public function prototypes ********** Index: firmware/App/Controllers/ConductivitySensors.c =================================================================== diff -u -rab14e70c7bac24b0c3ebd02c6763285cdd3951ce -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision ab14e70c7bac24b0c3ebd02c6763285cdd3951ce) +++ firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -499,8 +499,7 @@ if ( EMSTAT_PICO_TIMING_NOT_MET_STATUS == status ) { - ++internalErrorCount[ sensorId ]; - if ( internalErrorCount[ sensorId ] > MAX_CONDUCTIVITY_SENSOR_FAILURES ) + if ( ++internalErrorCount[ sensorId ] > MAX_CONDUCTIVITY_SENSOR_FAILURES ) { SET_ALARM_WITH_1_U32_DATA( ALARM_ID_CONDUCTIVITY_SENSOR_FAULT, sensorId ); } Index: firmware/App/Controllers/DialysateFlow.c =================================================================== diff -u -r867521a9810f2218c34d96164fab614494a63f8d -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Controllers/DialysateFlow.c (.../DialysateFlow.c) (revision 867521a9810f2218c34d96164fab614494a63f8d) +++ firmware/App/Controllers/DialysateFlow.c (.../DialysateFlow.c) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -198,6 +198,7 @@ * TEST SUPPORT FUNCTIONS *************************************************************************/ + /*********************************************************************//** * @brief * The testSetDialysateFlowDataPublishIntervalOverride function overrides the Index: firmware/App/Controllers/FluidLeak.c =================================================================== diff -u -r95eefee71702fbf031025dc35ebaf553dfb050b7 -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Controllers/FluidLeak.c (.../FluidLeak.c) (revision 95eefee71702fbf031025dc35ebaf553dfb050b7) +++ firmware/App/Controllers/FluidLeak.c (.../FluidLeak.c) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -73,7 +73,6 @@ { BOOL noFluidLeakDetected = noFPGAFluidLeakDetected(); - if ( getCurrentOperationMode() != DG_MODE_INIT ) { // Get latest state reading Index: firmware/App/Controllers/FluidLeak.h =================================================================== diff -u -ra7ce8c41a18998898d7525c0a7bf4d7d40c5371a -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Controllers/FluidLeak.h (.../FluidLeak.h) (revision a7ce8c41a18998898d7525c0a7bf4d7d40c5371a) +++ firmware/App/Controllers/FluidLeak.h (.../FluidLeak.h) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -47,7 +47,6 @@ U32 fluidLeakState; ///< Fluid leak state. } FLUID_LEAK_DATA_T; - // ********** public function prototypes ********** void initFluidLeak( void ); Index: firmware/App/Controllers/Heaters.c =================================================================== diff -u -rb0a5452ec4b9be9be937095b1249079a2fce5ce5 -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision b0a5452ec4b9be9be937095b1249079a2fce5ce5) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -95,10 +95,7 @@ BOOL startHeaterSignal; ///< Heater start indication flag. BOOL isHeaterOn; ///< Heater on/off status flag. F32 dutycycle; ///< Heater duty cycle. - F32 dutyCyle4NonZeroFlow; ///< Heater duty cycle for the non-zero flow. F32 targetROFlow; ///< Heater target flow. - U32 heaterOnWithNoFlowTimer; ///< Heater on with no flow timer. - BOOL isFlowBelowMin; ///< Heater flow below minimum flag indicator. BOOL hasTargetTempChanged; ///< Heater target temperature change flag indicator. F32 heaterEfficiency; ///< Heater efficiency during the run. BOOL hasTargetBeenReached; ///< Heater flag to indicate whether the target temperature has been reached. @@ -141,14 +138,14 @@ void initHeaters( void ) { DG_HEATERS_T heater; - dataPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; for ( heater = DG_PRIMARY_HEATER; heater < NUM_OF_DG_HEATERS; heater++ ) { - heatersStatus[ heater ].startHeaterSignal = FALSE; - heatersStatus[ heater ].state = HEATER_EXEC_STATE_OFF; heatersStatus[ heater ].targetTemp = 0.0; + heatersStatus[ heater ].state = HEATER_EXEC_STATE_OFF; + heatersStatus[ heater ].startHeaterSignal = FALSE; + heatersStatus[ heater ].isHeaterOn = FALSE; heatersStatus[ heater ].dutycycle = 0.0; heatersStatus[ heater ].targetROFlow = 0.0; heatersStatus[ heater ].hasTargetTempChanged = FALSE; @@ -383,35 +380,6 @@ BOOL isFlowLow = ( measFlow < minFlow ? TRUE : FALSE ); checkPersistentAlarm( ALARM_ID_DG_FLOW_TOO_LOW_WHILE_HEATER_ON, isFlowLow, measFlow, minFlow ); - - /* TODO remove this code once the heaters fault is finalized - if ( TRUE == isFlowLow ) - { - // Check if the flow of the heater is below minimum for the first time - if ( FALSE == heatersStatus[ heater ].isFlowBelowMin ) - { - // Set the variables for the flow below minimum situation. - // Remember the current duty cycle of the heater - heatersStatus[ heater ].isFlowBelowMin = TRUE; - heatersStatus[ heater ].heaterOnWithNoFlowTimer = getMSTimerCount(); - heatersStatus[ heater ].dutyCyle4NonZeroFlow = heatersStatus[ heater ].dutycycle; - } - else if ( TRUE == didTimeout( heatersStatus[ heater ].heaterOnWithNoFlowTimer, HEATERS_ON_NO_FLOW_TIMEOUT_MS ) ) - { - // The flow is below minimum for a certain period of time so set the heater's duty cycle to 0. The heaters is not - // set to off and its duty cycle is set to 0 - setHeaterDutyCycle( heater, HEATERS_MIN_DUTY_CYCLE ); - - } - } - else - { - heatersStatus[ heater ].isFlowBelowMin = FALSE; - heatersStatus[ heater ].heaterOnWithNoFlowTimer = getMSTimerCount(); - - // Flow is back on, set the heater to the duty cycle that was saved before zeroing the heater - setHeaterDutyCycle( heater, heatersStatus[ heater ].dutyCyle4NonZeroFlow ); - }*/ } else { @@ -655,37 +623,24 @@ *************************************************************************/ static void setHeaterDutyCycle( DG_HEATERS_T heater, F32 pwm ) { - // Only if there is a minimum flow, or if 0 duty cycle has been requested, the duty cycle can be changed - // This is to make sure while heaters are temporarily turned off due to a flow drop are not set to another - // duty cycle that might cause an over heat since there is no water flowing through - if ( ( FALSE == heatersStatus[ heater ].isFlowBelowMin ) || ( pwm < NEARLY_ZERO ) ) + // Check if the requested duty cycle is different from what the heater's duty cycle is. + // If the same duty cycle is requested, then it is not needed to send it again. This is to make sure + // the same duty cycle is not sent to the hardware all the time. + if ( fabs( heatersStatus[ heater ].dutycycle - pwm ) > NEARLY_ZERO ) { - // Check if the requested duty cycle is different from what the heater's duty cycle is. - // If the same duty cycle is requested, then it is not needed to send it again. This is to make sure - // the same duty cycle is not sent to the hardware all the time. - if ( fabs( heatersStatus[ heater ].dutycycle - pwm ) > NEARLY_ZERO ) + if ( DG_PRIMARY_HEATER == heater ) { - if ( DG_PRIMARY_HEATER == heater ) - { - setMainPrimaryHeaterPWM( pwm ); - setSmallPrimaryHeaterPWM( pwm ); - } - else if ( DG_TRIMMER_HEATER == heater ) - { - setTrimmerHeaterPWM( pwm ); - } - - // Updated the heater's information - heatersStatus[ heater ].dutycycle = pwm; + setMainPrimaryHeaterPWM( pwm ); + setSmallPrimaryHeaterPWM( pwm ); } + else if ( DG_TRIMMER_HEATER == heater ) + { + setTrimmerHeaterPWM( pwm ); + } + + // Updated the heater's information + heatersStatus[ heater ].dutycycle = pwm; } - else - { - // The flow is below minimum and the heater is temporarily powered down - // Update the other duty cycle with the requested duty cycle so as soon as the - // flow is back on, the new duty cycle is set - heatersStatus[ heater ].dutyCyle4NonZeroFlow = pwm; - } } /*********************************************************************//** Index: firmware/App/Controllers/Pressures.c =================================================================== diff -u -r8fe65bf6222137cc7182ccacff3a5f2fb2f03753 -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Controllers/Pressures.c (.../Pressures.c) (revision 8fe65bf6222137cc7182ccacff3a5f2fb2f03753) +++ firmware/App/Controllers/Pressures.c (.../Pressures.c) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -383,7 +383,6 @@ U08 i; U16 sensorADC; U16 sensorsADC[ PRESSURE_SENSORS_ADC_CHECK_ARRAY_LEN ]; - SELF_TEST_STATUS_T result = SELF_TEST_STATUS_PASSED; // Insert the pressure sensors ADC read into the array Index: firmware/App/Controllers/Switches.c =================================================================== diff -u -r264d5853c97ab9550878609c9302e87464078734 -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Controllers/Switches.c (.../Switches.c) (revision 264d5853c97ab9550878609c9302e87464078734) +++ firmware/App/Controllers/Switches.c (.../Switches.c) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -86,7 +86,6 @@ void execSwitches( void ) { U08 i; - U08 currentSwitchStatus = 0; for ( i = 0; i < NUM_OF_CAPS; i++ ) Index: firmware/App/Controllers/Switches.h =================================================================== diff -u -r264d5853c97ab9550878609c9302e87464078734 -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Controllers/Switches.h (.../Switches.h) (revision 264d5853c97ab9550878609c9302e87464078734) +++ firmware/App/Controllers/Switches.h (.../Switches.h) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -37,7 +37,7 @@ { CONCENTRATE_CAP = 0, ///< Concentrate cap DIALYSATE_CAP, ///< Dialysate cap - NUM_OF_CAPS ///< Number of doors and caps + NUM_OF_CAPS ///< Number of caps } SWITCH_T; /// DG doors and caps data publish structure Index: firmware/App/Modes/ModeChemicalDisinfect.c =================================================================== diff -u -ra727129f5f547fc7a46f481417f7b926454d3e97 -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Modes/ModeChemicalDisinfect.c (.../ModeChemicalDisinfect.c) (revision a727129f5f547fc7a46f481417f7b926454d3e97) +++ firmware/App/Modes/ModeChemicalDisinfect.c (.../ModeChemicalDisinfect.c) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -999,12 +999,11 @@ static DG_CHEM_DISINFECT_STATE_T handleChemicalDisinfectPrimeAcidLineState( void ) { DG_CHEM_DISINFECT_STATE_T state = DG_CHEM_DISINFECT_STATE_PRIME_ACID_LINE; + F32 cd2Conductivity = getConductivityValue( (U32)CONDUCTIVITYSENSORS_CD2_SENSOR ); // Set the chemical disinfect that is published on the UI chemDisinfectUIState = CHEM_DISINFECT_UI_STATE_MIX_WATER_AND_ACID; - F32 cd2Conductivity = getConductivityValue( (U32)CONDUCTIVITYSENSORS_CD2_SENSOR ); - if ( cd2Conductivity <= MIN_ACID_CONDUCTIVITY_US_PER_CM ) { primeAcidSteadyStateCounter = 0; Index: firmware/App/Modes/ModeFill.c =================================================================== diff -u -rab14e70c7bac24b0c3ebd02c6763285cdd3951ce -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision ab14e70c7bac24b0c3ebd02c6763285cdd3951ce) +++ firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -616,6 +616,7 @@ if ( TRUE == didTimeout( concentrateTestStartTime, CONCENTRATE_TEST_TIME_OUT_MS ) ) { BOOL haveTestsPassed = FALSE; + averageBicarbConductivity = totalBicarbConductivity / bicarbConductivitySampleCount; averageAcidConductivity = totalAcidConductivity / acidConductivitySampleCount; pctDiffInConductivity = fabs( 2.0 * ( averageAcidConductivity - averageBicarbConductivity ) / @@ -796,17 +797,14 @@ { setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); setROPumpTargetFlowRateLPM( TARGET_RO_FLOW_RATE_IN_PAUSE_L, TARGET_RO_PRESSURE_PSI ); - requestConcentratePumpOff( CONCENTRATEPUMPS_CP1_ACID ); requestConcentratePumpOff( CONCENTRATEPUMPS_CP2_BICARB ); - havePauseActuatorsBeenSet = TRUE; } if ( FALSE == areInletWaterConditionsAlarmsActive() ) { setValveState( VPO, VALVE_STATE_FILL_C_TO_NC ); - havePauseActuatorsBeenSet = FALSE; result = DG_FILL_MODE_STATE_START; } @@ -971,6 +969,7 @@ * TEST SUPPORT FUNCTIONS *************************************************************************/ + /*********************************************************************//** * @brief * The testSetUsedAcidVolumeMLOverride function overrides the Index: firmware/App/Modes/ModeGenIdle.c =================================================================== diff -u -rab14e70c7bac24b0c3ebd02c6763285cdd3951ce -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Modes/ModeGenIdle.c (.../ModeGenIdle.c) (revision ab14e70c7bac24b0c3ebd02c6763285cdd3951ce) +++ firmware/App/Modes/ModeGenIdle.c (.../ModeGenIdle.c) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -60,7 +60,7 @@ static U32 hdLostCommStartTime_ms; ///< Lost communication with HD start time in ms. static U32 targetFillVolumeML; ///< Save the target fill volume before calling startFillCmd(). static BOOL handleBadFillFlag; ///< Internal signal flag to handle bad fill. -static HD_OP_MODE_T hdMode; ///< HD operations mode. +static HD_OP_MODE_T hdMode = MODE_STAN; ///< HD operations mode. static OVERRIDE_U32_T badFillSubstatesPublishInterval = { BAD_FILL_SUBSTATES_PUB_INTERVAL, ///< Interval (in ms) at which to publish bad fill sub-states to CAN bus. BAD_FILL_SUBSTATES_PUB_INTERVAL, 0, 0 }; Index: firmware/App/Modes/ModeHeatDisinfect.c =================================================================== diff -u -ra727129f5f547fc7a46f481417f7b926454d3e97 -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision a727129f5f547fc7a46f481417f7b926454d3e97) +++ firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -198,7 +198,7 @@ static DG_HEAT_DISINFECT_STATE_T handleHeatDisinfectCompleteState( void ); static void failHeatDisinfect( void ); -static DG_RESERVOIR_STATUS_T getRsrvrFillStatus( DG_RESERVOIR_ID_T r, F32 targetVol, U32 timeout ); +static DG_RESERVOIR_STATUS_T getRsrvrFillStatus( DG_RESERVOIR_ID_T reservoir, F32 targetVol, U32 timeout ); static DG_RESERVOIR_STATUS_T getRsrvrDrainStatus( DG_RESERVOIR_ID_T r, U32 drainSteadyStateTimeout, U32 timeout ); static HEAT_DISINFECT_STATUS_T getHeatDisinfectStatus( void ); static void publishHeatDisinfectData( void ); @@ -437,24 +437,23 @@ static DG_HEAT_DISINFECT_STATE_T handleHeatDisinfectStartState( void ) { DG_HEAT_DISINFECT_STATE_T state = DG_HEAT_DISINFECT_STATE_DRAIN_R1; + F32 ppiPressure = getMeasuredDGPressure( PRESSURE_SENSOR_RO_PUMP_INLET ); + F32 TDiTemp = getTemperatureValue( TEMPSENSORS_INLET_DIALYSATE ); + F32 TRoTemp = getTemperatureValue( TEMPSENSORS_OUTLET_REDUNDANT ); // Start overall heat disinfect timer overallHeatDisinfectTimer = getMSTimerCount(); // Set all the actuators to reset and de-energized state deenergizeActuators(); - F32 ppiPressure = getMeasuredDGPressure( PRESSURE_SENSOR_RO_PUMP_INLET ); - F32 TDiTemp = getTemperatureValue( TEMPSENSORS_INLET_DIALYSATE ); - F32 TRoTemp = getTemperatureValue( TEMPSENSORS_OUTLET_REDUNDANT ); - // If the inlet pressure is less than the threshold and TDi and TRo difference is greater than 3 C, the cycle // should be canceled if ( ( ppiPressure < MIN_INLET_PRESSURE_PSI ) && ( fabs( TDiTemp - TRoTemp ) > MAX_START_STATE_TEMP_SENSORS_DIFF_C ) ) { - prevHeatDisinfectState = state; + prevHeatDisinfectState = state; alarmDetectedPendingTrigger = ALARM_ID_DG_HEAT_DISINFECT_INLET_PRES_AND_TEMP_SNSRS_OUT; - state = DG_HEAT_DISINFECT_STATE_CANCEL_BASIC_PATH; + state = DG_HEAT_DISINFECT_STATE_CANCEL_BASIC_PATH; } else { @@ -1556,11 +1555,13 @@ // First reservoir 2 must be completely full if ( DG_RESERVOIR_BELOW_TARGET == rsrvr2Status ) { + // Keep monitoring the status of reservoir 1 as the same time + F32 volume = getLoadCellSmallFilteredWeight( LOAD_CELL_RESERVOIR_1_PRIMARY ); + rsrvr2Status = getRsrvrFillStatus( DG_RESERVOIR_2, RSRVRS_FULL_VOL_ML, RSRVRS_FILL_UP_TIMEOUT_MS ); U32 drainPumpRPM = getDrainPumpTargetRPM(); - // Keep monitoring the status of reservoir 1 as the same time - F32 volume = getLoadCellSmallFilteredWeight( LOAD_CELL_RESERVOIR_1_PRIMARY ); + // Reservoir 1 cannot be filled before reservoir 2 is filled and is overflowing to reservoir 1. If reservoir 1 has already // reached to target volume, it means reservoir 2's load cell might be reading incorrect values. This situation might continue // until reservoir 1 is filled up and the tubing might expand or leak. @@ -1695,14 +1696,12 @@ if ( CANCELLATION_MODE_NONE == cancellationMode ) { U32 targetRPM = 0; + F32 TDi = getTemperatureValue( TEMPSENSORS_INLET_DIALYSATE ); + F32 TRo = getTemperatureValue( TEMPSENSORS_OUTLET_REDUNDANT ); // Stop all the actuators first then decide who should run next deenergizeActuators(); - // Check inlet dialysate and redundant outlet temperature sensors - F32 TDi = getTemperatureValue( TEMPSENSORS_INLET_DIALYSATE ); - F32 TRo = getTemperatureValue( TEMPSENSORS_OUTLET_REDUNDANT ); - // The two sensors must be less than a threshold to decide if mix drain is needed to normal drain if ( ( TDi < MIX_DRAIN_TEMPERATURE_THRESHOLD_C ) && ( TRo < MIX_DRAIN_TEMPERATURE_THRESHOLD_C ) ) { @@ -1825,27 +1824,27 @@ * complete and exits the heat disinfect mode. * @details Inputs: rsrvrFillStableTimeCounter, alarm, stateTimer * @details Outputs: none - * @param r is DG_RESERVOIR_1 or DG_RESERVOIR_2 + * @param reservoir is DG_RESERVOIR_1 or DG_RESERVOIR_2 * @param targetVol is the target fill volume * @param timeout is the fill up timeout * @return the status of the reservoirs during filling *************************************************************************/ -static DG_RESERVOIR_STATUS_T getRsrvrFillStatus( DG_RESERVOIR_ID_T r, F32 targetVol, U32 timeout ) +static DG_RESERVOIR_STATUS_T getRsrvrFillStatus( DG_RESERVOIR_ID_T reservoir, F32 targetVol, U32 timeout ) { DG_RESERVOIR_STATUS_T status = DG_RESERVOIR_BELOW_TARGET; F32 volume = 0.0; - if ( r == DG_RESERVOIR_1 ) + if ( DG_RESERVOIR_1 == reservoir ) { volume = getLoadCellSmallFilteredWeight( LOAD_CELL_RESERVOIR_1_PRIMARY ); } - else if ( r == DG_RESERVOIR_2 ) + else if ( DG_RESERVOIR_2 == reservoir ) { volume = getLoadCellSmallFilteredWeight( LOAD_CELL_RESERVOIR_2_PRIMARY ); } else { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_DG_RESERVOIR_SELECTED, r ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_DG_RESERVOIR_SELECTED, reservoir ) } // Check the volume of the reservoir against the target volume @@ -2103,6 +2102,7 @@ // Set the variables to fail and go to cancel water path. Set the pending alarm to no alarm so the cancel water path // will not be raising the alarm at end of the cancel water path. The recoverable alarm is raised here in this function U32 cap = (U32)( STATE_OPEN == getSwitchStatus( CONCENTRATE_CAP ) ? CONCENTRATE_CAP : DIALYSATE_CAP ); + prevHeatDisinfectState = heatDisinfectState; heatDisinfectState = DG_HEAT_DISINFECT_STATE_CANCEL_WATER_PATH; alarmDetectedPendingTrigger = ALARM_ID_DG_DIALYSATE_OR_CONC_CAP_NOT_IN_PROPER_POSITION; Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r4853f9f01e6a406783201902937d9ace760b0b38 -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 4853f9f01e6a406783201902937d9ace760b0b38) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -406,12 +406,11 @@ if ( ( DG_MODE_STAN == getCurrentOperationMode() && DG_STANDBY_MODE_STATE_IDLE == standbyState ) || ( DG_MODE_SOLO == getCurrentOperationMode() ) ) { DG_CMD_RESPONSE_T cmdResponse; - - cmdResponse.commandID = DG_CMD_START_FLUSH; - cmdResponse.rejected = FALSE; - cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_NONE; OPN_CLS_STATE_T concCap = getSwitchStatus( CONCENTRATE_CAP ); OPN_CLS_STATE_T diaCap = getSwitchStatus( DIALYSATE_CAP ); + cmdResponse.commandID = DG_CMD_START_FLUSH; + cmdResponse.rejected = FALSE; + cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_NONE; #ifndef _RELEASE_ if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_DISABLE_CAPS_MONITOR ) ) Index: firmware/App/Services/Reservoirs.c =================================================================== diff -u -ra6dff99e22bb6f646adfe3acf4f461cb43aec979 -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision a6dff99e22bb6f646adfe3acf4f461cb43aec979) +++ firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -783,7 +783,6 @@ reservoirWeightUnchangeStartTime[ reservoirId ] = 0; reservoirPreviousStatus[ reservoirId ].previousReservoirWeightG = getLoadCellSmallFilteredWeight( associatedLoadCell[ reservoirId ] ); reservoirPreviousStatus[ reservoirId ].previousDrainFlowML = 0.0; - } Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -rab14e70c7bac24b0c3ebd02c6763285cdd3951ce -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision ab14e70c7bac24b0c3ebd02c6763285cdd3951ce) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -1201,6 +1201,7 @@ * TEST SUPPORT FUNCTIONS *************************************************************************/ + /*********************************************************************//** * @brief * The testSetHDCommunicationStatus function sets the override Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -rcf09481b5414eac4f0452c53fc32b0796140ed1d -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision cf09481b5414eac4f0452c53fc32b0796140ed1d) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -1161,6 +1161,7 @@ * TEST SUPPORT FUNCTIONS *************************************************************************/ + /*********************************************************************//** * @brief * The isTestingActivated function determines whether a tester has successfully Index: firmware/App/Tasks/TaskGeneral.c =================================================================== diff -u -r8fe65bf6222137cc7182ccacff3a5f2fb2f03753 -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision 8fe65bf6222137cc7182ccacff3a5f2fb2f03753) +++ firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -88,6 +88,9 @@ // Monitor DG voltages execVoltagesMonitor(); + // run operation mode state machine + execOperationModes(); + // Monitor thermistors state machine execThermistors(); @@ -115,9 +118,6 @@ // Heaters controller execHeaters(); - - // run operation mode state machine - execOperationModes(); // Run non-volatile data management state machine that sends the data record // to Dialin Index: firmware/App/Tasks/TaskPriority.c =================================================================== diff -u -r8fe65bf6222137cc7182ccacff3a5f2fb2f03753 -r0803f828b81e046166457564650acf6a9bbd3cc6 --- firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision 8fe65bf6222137cc7182ccacff3a5f2fb2f03753) +++ firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision 0803f828b81e046166457564650acf6a9bbd3cc6) @@ -110,7 +110,6 @@ #ifdef TASK_TIMING_OUTPUT_ENABLED // SET_TASK_OFF(); // TODO - uncomment and define TASK_TIMING_OUTPUT_ENABLED to monitor this tasks timing #endif - } /**@}*/