Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -rb50acaa8dda74292fb41110440eaaa40f2959fb7 -re48bec7b1330b195afadcbf8bc58bdb4f1d5b03e --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision b50acaa8dda74292fb41110440eaaa40f2959fb7) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision e48bec7b1330b195afadcbf8bc58bdb4f1d5b03e) @@ -39,10 +39,10 @@ // ********** private definitions ********** -#define BAL_CHAMBER_DATA_PUBLISH_INTERVAL ( 250 / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the balancing chamber data published. -#define BAL_CHAMBER_FILL_PRES_DROP_MS ( 200 / TASK_GENERAL_INTERVAL ) ///< Time (ms/tasktime) to confirm the balancing chamber filling started and corrosponding valves opened. -#define BAL_CHAMBER_FILL_COMPLETE_MS ( 300 / TASK_GENERAL_INTERVAL ) ///< Time (ms/tasktime) to confirm the balancing chamber fill completed and pressure is within range -#define DRY_BICARB_CHAMBER_MAX_TIMEOUT_COUNT ( 20 * 15 ) ///< Periodic bicarb chamber fill request. +#define BAL_CHAMBER_DATA_PUBLISH_INTERVAL ( 250 / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the balancing chamber data published. +#define BAL_CHAMBER_FILL_PRES_DROP_MS ( 200 / TASK_GENERAL_INTERVAL ) ///< Time (ms/tasktime) to confirm the balancing chamber filling started and corresponding valves opened. +#define BAL_CHAMBER_FILL_COMPLETE_MS ( 300 / TASK_GENERAL_INTERVAL ) ///< Time (ms/tasktime) to confirm the balancing chamber fill completed and pressure is within range +#define BAL_CHAMBER_BICARB_CHAMBER_FILL_TIMEOUT_COUNT ( 1 * SEC_PER_MIN * ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ) ///< Periodic bicarb chamber fill request. /// Payload record structure for balancing chamber switch only request typedef struct @@ -73,9 +73,11 @@ static F32 lastTdDialysateFlowrate; ///< Previous TD dialysate flow rate static F32 freshDialPressure; ///< Fresh side dialysate pressure static F32 spentDialPressure; ///< Spent side dialysate pressure + #ifdef __DRY_BICARB__ static U32 dryBiCarbChamberFillTimeoutCount; ///< Counter for checking the timeout for drybicart chamber fill request. #endif + // ********** private function prototypes ********** static BAL_CHAMBER_EXEC_STATE_T handleBalChamberState1FillStart( void ); @@ -203,14 +205,13 @@ //Increment counter for dry bicarb chamber fill dryBiCarbChamberFillTimeoutCount += 1; // Fill bicarb chamber once every 60secs. - if ( dryBiCarbChamberFillTimeoutCount >= DRY_BICARB_CHAMBER_MAX_TIMEOUT_COUNT) + if ( dryBiCarbChamberFillTimeoutCount >= BAL_CHAMBER_BICARB_CHAMBER_FILL_TIMEOUT_COUNT) { setBicarbChamberFillRequested(); dryBiCarbChamberFillTimeoutCount = 0; } #endif - // execute current balancing chamber exec state switch ( balChamberExecState ) { case BAL_CHAMBER_STATE_START: