Index: firmware/App/Controllers/DryBiCart.c =================================================================== diff -u -r4b50c945c62de5a6d8d6278c757d01f5cdf4b3c4 -rff1b8b02621afef8e65d68f8253662ac86a83479 --- firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision 4b50c945c62de5a6d8d6278c757d01f5cdf4b3c4) +++ firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision ff1b8b02621afef8e65d68f8253662ac86a83479) @@ -42,11 +42,13 @@ #define DRY_BICART_VENT_COMPLETE_PRESSURE 1.5F ///< Pressure reached to inidcate the drybicart venting being completed. #define DRY_BICART_VENT_TIME_MS ( 1 * MS_PER_SECOND ) ///< Wait time to vent dry bibag gas before actuating Bicarb chamber(F) venting. #define DRY_BICART_VENT_MAX_TIME_MS ( 10 * MS_PER_SECOND ) ///< Max time to vent both bicart and Chamber F. -#define DRY_BICART_FILL_DURATION_DIFF_MS 100 ///< Fill duration difference between last and current fill cycle. -#define DRY_BICART_FILL_DURATION_MIN_MS 1000 ///< Minimum fill duration to be met to end the fill cycle. +#define DRY_BICART_FILL_DURATION_DIFF_MS 500 ///< Fill duration difference between last and current fill cycle. +#define DRY_BICART_FILL_DURATION_MIN_MS 1500 ///< Minimum fill duration to be met to end the fill cycle. #define DRY_BICART_DEFAULT_MAX_FILL_CYCLE_CNT 10 ///< Default max fill cycle allowed for dry bicart fill/mix with water. #define DRY_BICART_MAX_FILL_CYCLE_CNT 30 ///< Max fill cycle allowed (by override) for dry bicart fill/mix with water. -#define VALV_D80_MAX_OPEN_TIME_MS ( 10 * MS_PER_SECOND ) ///< Max time allowed for opening D80 valve during bicarb chamber (F) fill. +//TODO: uncomment later based on the testing results +//#define VALV_D80_MAX_OPEN_TIME_MS ( 10 * MS_PER_SECOND ) ///< Max time allowed for opening D80 valve during bicarb chamber (F) fill. +#define VALV_D80_MAX_OPEN_TIME_MS ( 2 * MS_PER_SECOND ) ///< Max time allowed for opening D80 valve during bicarb chamber (F) fill. /// Payload record structure for dry bicart fill request typedef struct @@ -334,7 +336,7 @@ static DRY_BICART_FILL_EXEC_STATE_T handleDryBicartFillDurationCheckState( void ) { DRY_BICART_FILL_EXEC_STATE_T state = DRY_BICART_FILL_DURATION_CHECK_STATE; - U32 diffInFillDuration = fabs( currentFillDurationInMS - lastFillDurationInMS ); + U32 diffInFillDuration = abs( currentFillDurationInMS - lastFillDurationInMS ); U32 dryBiCartMaxFillCount = getU32OverrideValue( &biCartMaxFillCycleCount ); F32 d66Pressure = getFilteredPressure( D66_PRES ); @@ -467,15 +469,16 @@ setValveState( D64_VALV, VALVE_STATE_CLOSED ); setValveState( D85_VALV, VALVE_STATE_CLOSED ); - // TODO : Confirm D80 open on chamber low or end of balancing chamber switching? - if ( LEVEL_STATE_LOW == bicarbChamberLevel ) - { + // TODO: Confirm D80 open on chamber low or end of balancing chamber switching? + // TODO: Enable the below code once level sensor is working + //if ( LEVEL_STATE_LOW == bicarbChamberLevel ) + //{ // Open the Bicarb chamber inlet valve setValveState( D80_VALV, VALVE_STATE_OPEN ); // Start a timer when bicarb supply started to chamber F dryBiCarbSupplyStartTime = getMSTimerCount(); state = BICARB_CHAMBER_FILL_STATE; - } + //} return state; }