Index: firmware/App/Controllers/DryBiCart.c =================================================================== diff -u -rde74366a9ca8be78f9b594de1e0938dc6060d179 -r4b50c945c62de5a6d8d6278c757d01f5cdf4b3c4 --- firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision de74366a9ca8be78f9b594de1e0938dc6060d179) +++ firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision 4b50c945c62de5a6d8d6278c757d01f5cdf4b3c4) @@ -46,7 +46,7 @@ #define DRY_BICART_FILL_DURATION_MIN_MS 1000 ///< 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 ( 10 * MS_PER_SECOND ) ///< Max time allowed for opening D80 valve. +#define VALV_D80_MAX_OPEN_TIME_MS ( 10 * 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 @@ -67,7 +67,7 @@ static OVERRIDE_U32_T bicarbChamberFillRequested; ///< Start/stop Bicarb chamber fill. static OVERRIDE_U32_T dryBiCartDataPublishInterval; ///< Dry bicart data publish interval. static U32 dryBiCartDataPublicationTimerCounter; ///< Used to schedule drybicart data publication to CAN bus. -static U32 dryBiCarbVentD80StartTime; ///< D80 vent start time. +static U32 dryBiCarbSupplyStartTime; ///< Bicarb supply start time from bicart to Chamber F. // ********** private function prototypes ********** @@ -117,7 +117,7 @@ currentFillDurationInMS = 0; dryBiCartDataPublicationTimerCounter = 0; biCartFillCycleCounter = 0; - dryBiCarbVentD80StartTime = 0; + dryBiCarbSupplyStartTime = 0; } /*********************************************************************//** @@ -250,7 +250,7 @@ F32 d66Pressure = getFilteredPressure( D66_PRES ); // Close dry bicart inlet water if bicart is filled with water - if ( d66Pressure >= DRY_BICART_FILL_COMPLETE_PRESSURE ) + if ( d66Pressure >= DRY_BICART_FILL_COMPLETE_PRESSURE ) { setValveState( D65_VALV, VALVE_STATE_CLOSED ); lastFillDurationInMS = currentFillDurationInMS; @@ -306,7 +306,6 @@ { //Vent chamber F setValveState( D64_VALV, VALVE_STATE_OPEN ); - dryBiCartFillStartTime = getMSTimerCount(); } // D66 pressure drops or time out @@ -473,8 +472,8 @@ { // Open the Bicarb chamber inlet valve setValveState( D80_VALV, VALVE_STATE_OPEN ); - // Start a timer when we open D80 - dryBiCarbVentD80StartTime = getMSTimerCount(); + // Start a timer when bicarb supply started to chamber F + dryBiCarbSupplyStartTime = getMSTimerCount(); state = BICARB_CHAMBER_FILL_STATE; } @@ -526,17 +525,13 @@ LEVEL_STATE_T bicarbChamberLevel = getLevelStatus( D63_LEVL ); // Once level reached, close the valve - if ( ( LEVEL_STATE_HIGH <= bicarbChamberLevel ) || - ( TRUE == didTimeout( dryBiCarbVentD80StartTime, VALV_D80_MAX_OPEN_TIME ) ) ) + if ( ( LEVEL_STATE_HIGH == bicarbChamberLevel ) || + ( TRUE == didTimeout( dryBiCarbSupplyStartTime, VALV_D80_MAX_OPEN_TIME_MS ) ) ) { setValveState( D65_VALV, VALVE_STATE_CLOSED ); setValveState( D80_VALV, VALVE_STATE_CLOSED ); state = BICARB_CHAMBER_START_STATE; } -// else -// { -// SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_BICARB_CHAMBER_INVALID_EXEC_STATE, state ); -// } // Close water inlet valve as fill is complete. if ( d66Pressure >= DRY_BICART_FILL_COMPLETE_PRESSURE )