Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -ra08213c3d131203c21554d743c3ccb02575b70da -r173453569b2eb31b3f19572bf5386440667b0162 --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision a08213c3d131203c21554d743c3ccb02575b70da) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 173453569b2eb31b3f19572bf5386440667b0162) @@ -208,12 +208,8 @@ *************************************************************************/ void transitionToBalChamberFill( void ) { - printf("[TRACE3] transitionToBalChamberFill ENTRY: tick=%lu priorPeriod=%lu priorLastQd=%.2f priorSwOnly=%d\n", - getMSTimerCount(), balChamberSwitchingPeriod, lastTdDialysateFlowrate, balanceChamberSwitchingOnly); initBalanceChamber(); updateBalChamberSwitchingPeriod(); - printf("[TRACE3b] transitionToBalChamberFill EXIT: tick=%lu newPeriod=%lu newLastQd=%.2f\n", - getMSTimerCount(), balChamberSwitchingPeriod, lastTdDialysateFlowrate); } /*********************************************************************//** @@ -227,21 +223,18 @@ void updateBalChamberSwitchingPeriod( void ) { F32 tdDialysateFlowrate = getTDDialysateFlowrate(); - printf("[TRACE4] updateBalChamberSwitchingPeriod: tick=%lu lastQd=%.4f newQd=%.4f isSwActive=%d execState=%d\n", - getMSTimerCount(), lastTdDialysateFlowrate, tdDialysateFlowrate, isBalChamberSwitchingActive, balChamberExecState); + if ( lastTdDialysateFlowrate != tdDialysateFlowrate ) { // Defer Qd timing update to FillEnd at end of the current BC switch if ( ( TRUE == isBalChamberSwitchingActive ) && ( BAL_CHAMBER_STATE_IDLE != balChamberExecState ) ) { pendingTdDialysateFlowrate = tdDialysateFlowrate; isBalChamberSwitchingPeriodUpdatePending = TRUE; - printf("[TRACE4a] Qd CHANGED branch taken\n"); } // Apply immediately when BC is inactive or still idle else { - printf("[TRACE4b] Qd UNCHANGED branch taken -- period NOT recalculated, stays at %lu\n", balChamberSwitchingPeriod); pendingTdDialysateFlowrate = tdDialysateFlowrate; isBalChamberSwitchingPeriodUpdatePending = TRUE; applyBalChamberSwitchingPeriod( pendingTdDialysateFlowrate ); @@ -305,8 +298,6 @@ // finish the balancing chamber fill 50 ms prior completing the regular cycle time. balChamberSwitchingPeriod -= 1; - printf("[TRACE5] Period calculated: tick=%lu switchFreq=%.4f period=%lu\n", - getMSTimerCount(), getBalChamberSwitchingFreq(), balChamberSwitchingPeriod); //Update last td dialysate flow rate lastTdDialysateFlowrate = tdDialysateFlowrate; @@ -323,8 +314,6 @@ //Testing balChamberValveClosePeriod = balChamberSwitchingPeriod; balChamberValveClosePeriod -= 1; // Close valves prior 50 msecond for testing - printf("[TRACE5b] ValveClosePeriod set: tick=%lu period=%lu closePeriod=%lu (CHECK FOR UNDERFLOW)\n", - getMSTimerCount(), balChamberSwitchingPeriod, balChamberValveClosePeriod); currentBalChamberFillCounter = 0; currentBalChamberSwitchingCounter = 0; @@ -901,8 +890,6 @@ { if ( TRUE == isBalChamberSwitchingPeriodUpdatePending ) { - printf("[TRACE7] BC forced IDLE via isBalChamberSwitchingOffRequested: tick=%lu D51=%.2f execState=%d\n", - getMSTimerCount(), getFilteredPressure(D51_PRES), balChamberExecState); applyBalChamberSwitchingPeriod( pendingTdDialysateFlowrate ); scheduleFirstCycleRelaxAfterQdApply(); } @@ -1174,8 +1161,6 @@ { if ( TRUE == isBalChamberSwitchingPeriodUpdatePending ) { - printf("[TRACE7] BC forced IDLE via isBalChamberSwitchingOffRequested: tick=%lu D51=%.2f execState=%d\n", - getMSTimerCount(), getFilteredPressure(D51_PRES), balChamberExecState); applyBalChamberSwitchingPeriod( pendingTdDialysateFlowrate ); scheduleFirstCycleRelaxAfterQdApply(); } @@ -1492,7 +1477,14 @@ return isBalChamberFillInProgress; } - +/*********************************************************************//** + * @brief + * The getBalancingChamberStatus function gets the balancing chamber switching + * status. + * @details \b Inputs: isBalChamberSwitchingActive + * @details \b Outputs: none + * @return balancing chamber switching status + *************************************************************************/ BOOL getBalancingChamberStatus( void ) { return isBalChamberSwitchingActive; @@ -1637,8 +1629,6 @@ return balancingError; } - - /*********************************************************************//** * @brief * The publishBalChamberData function broadcasts the balancing chamber