Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -rdf87716215d606300dd2617a6854b7071c0ce545 -rb26c5dd805f0c95856456fd16c8fc9c56659f76e --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision df87716215d606300dd2617a6854b7071c0ce545) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision b26c5dd805f0c95856456fd16c8fc9c56659f76e) @@ -260,7 +260,7 @@ currentBalChamberSwitchingCounter += 1; currentBalChamberFillCounter += 1; - if ( getTestConfigStatus( TEST_CONFIG_DD_ENABLE_DRY_BICARB ) == TRUE && balChamberExecState > BAL_CHAMBER_STATE_IDLE) + if ( ( getTestConfigStatus( TEST_CONFIG_DD_ENABLE_DRY_BICARB ) == TRUE ) && ( balChamberExecState > BAL_CHAMBER_STATE_IDLE ) ) { // Increment counter for dry bicarb chamber fill bicarbChamberPeriodicFillCounter += 1; @@ -510,8 +510,8 @@ { F32 acidVolume; F32 bicarbVolume; - BAL_CHAMBER_EXEC_STATE_T state = BAL_CHAMBER_STATE1_FILL_START; + balChamberSWState = BAL_CHAMBER_SW_STATE1; balChamberFillTimeoutCount = 0; isBalChamberFillInProgress = FALSE; @@ -655,12 +655,13 @@ static BAL_CHAMBER_EXEC_STATE_T handleBalChamberState1ValvesClose( void ) { BAL_CHAMBER_EXEC_STATE_T state = BAL_CHAMBER_STATE1_VALVES_CLOSE; - freshDialPressure = getFilteredPressure( D18_PRES ); - spentDialPressure = getFilteredPressure( D51_PRES ); BOOL isBothFillsComplete = FALSE; BOOL isFirstCycleNotDone = FALSE; BOOL isFillCompleteOrFirstCycle = FALSE; + freshDialPressure = getFilteredPressure( D18_PRES ); + spentDialPressure = getFilteredPressure( D51_PRES ); + // If fill is taking too long, set an alarm for fill timeout if ( ( balChamberFillTimeoutCount > 0 ) && ( currentBalChamberFillCounter > balChamberFillTimeoutCount ) ) { @@ -815,8 +816,8 @@ { F32 acidVolume; F32 bicarbVolume; - BAL_CHAMBER_EXEC_STATE_T state = BAL_CHAMBER_STATE2_FILL_START; + isBalChamberFillInProgress = FALSE; isPressureStabilizedDuringFill = FALSE; isPressureDroppedDuringFill = FALSE; @@ -902,12 +903,13 @@ static BAL_CHAMBER_EXEC_STATE_T handleBalChamberState2ValvesClose( void ) { BAL_CHAMBER_EXEC_STATE_T state = BAL_CHAMBER_STATE2_VALVES_CLOSE; - freshDialPressure = getFilteredPressure( D18_PRES ); - spentDialPressure = getFilteredPressure( D51_PRES ); BOOL isBothFillsComplete = FALSE; BOOL isFirstCycleNotDone = FALSE; BOOL isFillCompleteOrFirstCycle = FALSE; + freshDialPressure = getFilteredPressure( D18_PRES ); + spentDialPressure = getFilteredPressure( D51_PRES ); + // Check fresh dialysate pressure back in range to indicate fill complete. if ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) { Index: firmware/App/Controllers/DryBiCart.c =================================================================== diff -u -rdf87716215d606300dd2617a6854b7071c0ce545 -rb26c5dd805f0c95856456fd16c8fc9c56659f76e --- firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision df87716215d606300dd2617a6854b7071c0ce545) +++ firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision b26c5dd805f0c95856456fd16c8fc9c56659f76e) @@ -281,8 +281,8 @@ for ( mixId = DIALYSATE_MIX_ID_FIRST; mixId < NUM_OF_DIALYSATE_MIXING_ID; mixId++ ) { - dialysateMix[ mixId ].dialysateMixingState = DIALYSATE_MIXING_OPEN_LOOP_STATE; - dialysateMix[ mixId ].controlTimerCounter = 0; + dialysateMix[ mixId ].dialysateMixingState = DIALYSATE_MIXING_OPEN_LOOP_STATE; + dialysateMix[ mixId ].controlTimerCounter = 0; } dryBiCartDataPublishInterval.data = DRY_BICART_DATA_PUBLISH_INTERVAL; @@ -481,34 +481,30 @@ { case DRY_BICART_IDLE: // run as idle state - dryBicartSubstate = 0x0; break; case DRY_BICART_INITIAL_FILL: // Dry bicart fill exec - dryBicartSubstate = execDryBicartFillMode(); + execDryBicartFillMode(); break; case DRY_BICART_SUPPLY: // Fill Bicarb chamber F exec - dryBicartSubstate = execBicarbChamberFillMode(); + execBicarbChamberFillMode(); break; case DRY_BICART_DRAIN: // Dry bicart drain exec - dryBicartSubstate = execDryBicartDrainMode(); + execDryBicartDrainMode(); break; default: // software fault, - dryBicartSubstate = 0x0; dryBicartStartRequest = DRY_BICART_IDLE; SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_DRY_BICART_FILL_INVALID_EXEC_STATE, dryBicartStartRequest ); break; } - // to avoid compilation warning since this parameter is not used any where - (void)dryBicartSubstate; // Publish dry bicart data publishDryBicartData(); } @@ -660,8 +656,6 @@ return dryBiCartDrainExecState; } - - /*********************************************************************//** * @brief * TThe getBicarbMixVol function gets the bicarb mix volume provided by the controller @@ -1641,9 +1635,9 @@ BICARB_CHAMBER_FILL_EXEC_STATE_T state = BICARB_SUPPLY_VENT_START_STATE; float setpoint; U32 startTime; - F32 d66Pressure = getFilteredPressure( D66_PRES ); - F32 tmpD66Pressure = getFilteredPressure( D66_PRES ); + F32 tmpD66Pressure = getFilteredPressure( D66_PRES ); + setpoint = d66Pressure - 1.0; if ( ( d66Pressure > DRY_BICART_FILL_INITIATE_SUPPLY_PRESSURE ) ) @@ -1922,8 +1916,6 @@ data.dryBiCartFillExecState = (U32)dryBiCartFillExecState; data.bicarbChamberFillExecState = (U32)bicarbChamberFillExecState; - // TODO : temporarily disabled. restore it after testing -#if 0 data.dryBiCartDrainExecState = (U32)dryBiCartDrainExecState; data.dryBiCartFillCycleCounter = biCartFillCycleCounter; data.dryBiCartMaxFillCycleCount = getU32OverrideValue( &biCartMaxFillCycleCount ); @@ -1934,7 +1926,6 @@ data.dryBiCartCurrentFillTime = currentFillDurationInMS; data.dryBiCartType = getU32OverrideValue( &dryBiCartType ); data.dryBiCartDrainTimePeriod = dryBiCartDrainTimePeriod; -#endif // TODO: remove after feature testing memcpy( &data.dryBiCartBicarbDosingControl, &bicarbControlSignals, sizeof( PI_CONTROLLER_SIGNALS_DATA ) ); @@ -2261,7 +2252,6 @@ * The testDryBiCartUpperCartPressureOverride function sets the override value * of bicart upper cart pressure * @details Inputs: dryBiCartUpperCartPressure - * * @details Outputs: dryBiCartUpperCartPressure * @param message Override message from Dialin which includes the override * value to override the bicart upper cart pressure @@ -2279,7 +2269,6 @@ * The testDryBiCartLowerCartPressureOverride function sets the override value * of Lowercart pressure * @details Inputs: dryBiCartLowerCartPressure - * * @details Outputs: dryBiCartLowerCartPressure * @param message Override message from Dialin which includes the override * value to override the bicart lower pressure. Index: firmware/App/Controllers/DryBiCart.h =================================================================== diff -u -r9b2aa25492c9286b9c1d5b0f4ce9e3676d9ade84 -rb26c5dd805f0c95856456fd16c8fc9c56659f76e --- firmware/App/Controllers/DryBiCart.h (.../DryBiCart.h) (revision 9b2aa25492c9286b9c1d5b0f4ce9e3676d9ade84) +++ firmware/App/Controllers/DryBiCart.h (.../DryBiCart.h) (revision b26c5dd805f0c95856456fd16c8fc9c56659f76e) @@ -39,8 +39,6 @@ { U32 dryBiCartFillExecState; ///< Dry bicart execution state U32 bicarbChamberFillExecState; ///< Bicarb chamber Fill execution state - //TODO: restore it after testing complete -#if 0 U32 dryBiCartDrainExecState; ///< Dry bicart drain execution state U32 dryBiCartFillCycleCounter; ///< Dry bicart fill cycle counter U32 dryBiCartMaxFillCycleCount; ///< Dry bicart fill cycle max count @@ -51,7 +49,7 @@ U32 dryBiCartCurrentFillTime; ///< Dry bicart current fill duration in milli second U32 dryBiCartType; ///< Dry bicart type (small-0/large-1) U32 dryBiCartDrainTimePeriod; ///< Dry bicart drain time based on catridge type (small/large) -#endif + // TODO: remove after closed loops stabilized PI_CONTROLLER_SIGNALS_DATA dryBiCartBicarbDosingControl; ///< Dry bicart bicarb dosing closed loop control signals data PI_CONTROLLER_SIGNALS_DATA dryBiCartAcidDosingControl; ///< Dry bicart acid dosing closed loop control signals data @@ -114,7 +112,6 @@ BOOL testDryBiCartAcidBicarbDeltaConductivityOverride( MESSAGE_T *message ); BOOL testDryBiCartAcidBicarbTargetConductivityOverride( MESSAGE_T *message ); - BOOL testDryBiCartUpperCartPressureOverride( MESSAGE_T *message ); BOOL testDryBiCartLowerCartPressureOverride( MESSAGE_T *message ); Index: firmware/App/Monitors/Conductivity.c =================================================================== diff -u -rd5c94536929ded738e5c8d139d8c46b1d3e035ef -rb26c5dd805f0c95856456fd16c8fc9c56659f76e --- firmware/App/Monitors/Conductivity.c (.../Conductivity.c) (revision d5c94536929ded738e5c8d139d8c46b1d3e035ef) +++ firmware/App/Monitors/Conductivity.c (.../Conductivity.c) (revision b26c5dd805f0c95856456fd16c8fc9c56659f76e) @@ -495,10 +495,8 @@ data.d17Cond = getFilteredConductivity( D17_COND ); data.d27Cond = getFilteredConductivity( D27_COND ); - data.d29Cond = getConductivity( D17_COND ); - data.d43Cond = getConductivity( D27_COND ); - // data.d29Cond = getFilteredConductivity( D29_COND ); - // data.d43Cond = getFilteredConductivity( D43_COND ); + data.d29Cond = getFilteredConductivity( D29_COND ); + data.d43Cond = getFilteredConductivity( D43_COND ); data.d74Cond = getFilteredConductivity( D74_COND ); ddConductivityPublishTimerCounter = 0;