Index: firmware/App/Controllers/DryBiCart.c =================================================================== diff -u -rcd1161514dbaff9e5b222931fff99618e39fd7ec -rf364406cd1f672078ca38ae8aad5bc508e9b64dd --- firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision cd1161514dbaff9e5b222931fff99618e39fd7ec) +++ firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision f364406cd1f672078ca38ae8aad5bc508e9b64dd) @@ -44,13 +44,17 @@ // ********** private definitions ********** #define DRY_BICART_DATA_PUBLISH_INTERVAL ( 250 / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the drybicart data published. -#define PRESSURE_OFFSET_PSI 7.0F ///< The difference between the actual pressure measured at bicart assembly and the measured D66 pressure based on the placement of the sensor +#define WCDI2_PRESSURE_OFFSET_PSI 7.0F ///< The difference between the actual pressure measured at bicart assembly and the measured D66 pressure based on the placement of the sensor for WCID1 +#define WCID1_PRESSURE_OFFSET_PSI 1.0F ///< The difference between the actual pressure measured at bicart assembly and the measured D66 pressure based on the placement of the sensor for WCID2 #define DRY_BICART_PERSISTENCE_DURATION_MS 200 ///< Fill persistence duration to overcome the pressure overshoot/ drop for beta 1.9 and above. // Dry Bicart Fill #define DRY_BICART_FILL_COMPLETE_TIME_MS ( 1 * MS_PER_SECOND ) ///< Wait time to reset the request flag after fill complete -#define DRY_BICART_FILL_COMPLETE_PRESSURE_PSI ( 10.0F + PRESSURE_OFFSET_PSI ) ///< Maximum pressure reached to indicate the dry bicart fill being completed. +#define DRY_BICART_WCID2_FILL_COMPLETE_PRESSURE_PSI ( 10.0F + WCDI2_PRESSURE_OFFSET_PSI ) ///< Maximum pressure reached to indicate the dry bicart fill being completed for WCID2 +#define DRY_BICART_WCID1_FILL_COMPLETE_PRESSURE_PSI ( 10.0F + WCID1_PRESSURE_OFFSET_PSI ) ///< Maximum pressure reached to indicate the dry bicart fill being completed for WCID1 +#define GET_DRY_BICART_FILL_COMPLETE_PRESSURE_PSI (getTestConfigStatus( TEST_CONFIG_DD_ENABLE_WCID_1 ) \ + != TRUE ? DRY_BICART_WCID2_FILL_COMPLETE_PRESSURE_PSI : DRY_BICART_WCID1_FILL_COMPLETE_PRESSURE_PSI ) #define DRY_BICART_FILL_INITIATE_PRESSURE_PSI 1.5F ///< Minimum pressure required to initiate the dry bicart fill process. #define DRY_BICART_FILL_COMPLETE_SUPPLY_PRESSURE_PSI 10.0F ///< Maximum pressure allowed at bicart fill during supply process/state #define DRY_BICART_FILL_INITIATE_SUPPLY_PRESSURE_PSI 3.0F ///< Minimum pressure required to initiate the dry bicart fill during supply process/state @@ -267,19 +271,8 @@ void execDryBicart( void ) { - //DRY_BICART_SUPPLY ; - //DRY_BICART_INITIAL_FILL; - //DRY_BICART_DRAIN; - //default DRY_BICART_IDLE; - // the below function select any one of the above request - //updateDrybicartOperation(); + execMixingControl(); - if( getCurrentBalancingChamberExecState() > BAL_CHAMBER_STATE_IDLE ) - { - // closed loop bicarb and acid mixing controller - execDialysateCompositionMixingController(); - } - // top level state machine selection DRY_BICART_OPERATION_T dryBicartState = dryBicartStartRequest; @@ -738,9 +731,10 @@ { DRY_BICART_FILL_EXEC_STATE_T state = DRY_BICART_FILL_WATER_END_STATE; F32 d66Pressure = getFilteredPressure( D66_PRES ); + F32 fillCompletePressure = GET_DRY_BICART_FILL_COMPLETE_PRESSURE_PSI; // Close dry bicart inlet water if D66 pressure is 17 PSI - if ( d66Pressure >= DRY_BICART_FILL_COMPLETE_PRESSURE_PSI ) + if ( d66Pressure >= fillCompletePressure ) { // start the persistence timer once d66 reaches 17 PSI if ( 0 == dryBiCartPersistenceStartTime ) @@ -1004,9 +998,10 @@ { BICARB_CHAMBER_FILL_EXEC_STATE_T state = BICARB_CARTRIDGE_FILL_WATER_END_STATE; F32 d66Pressure = getFilteredPressure( D66_PRES ); + F32 fillCompletePressure = GET_DRY_BICART_FILL_COMPLETE_PRESSURE_PSI; // check D66 pressure greater than or equal to 17 PSI - if ( d66Pressure >= DRY_BICART_FILL_COMPLETE_PRESSURE_PSI ) + if ( d66Pressure >= fillCompletePressure ) { // start the persistence timer once d66 reaches 17 PSI if ( 0 == dryBiCartPersistenceStartTime )