Index: firmware/App/Controllers/DryBiCart.c =================================================================== diff -u -rc57cf925c5920ff87fae1804b3b39c651fe008a0 -rf031f37d3f9985c1224472f2827cd180287c5621 --- firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision c57cf925c5920ff87fae1804b3b39c651fe008a0) +++ firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision f031f37d3f9985c1224472f2827cd180287c5621) @@ -44,6 +44,7 @@ // Dry Bicart Fill #define DRY_BICART_FILL_DURATION_MIN_MS (2 * MS_PER_SECOND) ///< Minimum fill duration to be met to end the fill cycle. +#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_DURATION_DIFF_MS 750 ///< Fill duration difference between last and current fill cycle. #define DRY_BICART_FILL_COMPLETE_PRESSURE 15.0F ///< Maximum pressure reached to indicate the dry bicart fill being completed. #define DRY_BICART_FILL_INITIATE_PRESSURE 5.0F ///< Minimum pressure required to initiate the dry bicart fill process. @@ -601,13 +602,17 @@ // TODO: close the D14 valve setValveState( D14_VALV, VALVE_STATE_CLOSED ); + + // TODO: remove ? start timer for timeout to reset fill complete state to DRY_BICART_START_STATE + dryBiCartFillStartTime = getMSTimerCount(); } else { // Stop drycart fill if fill request flag is set to false. if ( FALSE == getU32OverrideValue( &dryBiCartFillRequested ) ) { dryBiCartFillRequested.data = FALSE; + state = DRY_BICART_START_STATE; } else @@ -633,11 +638,16 @@ // stay in this state till bicart request is cleared so that fill complete status can be checked DRY_BICART_FILL_EXEC_STATE_T state = DRY_BICART_FILL_COMPLETE_STATE; - // Go idle - dryBiCartFillRequested.data = FALSE; - // for this request override also cleared - dryBiCartFillRequested.ovData = FALSE; - state = DRY_BICART_START_STATE; + // TODO: check whether its required or not, right now in pre-gen need to check the fill complete status + // TODO: implement the broadcast message for fill complete + if ( TRUE == didTimeout( dryBiCartFillStartTime, DRY_BICART_FILL_COMPLETE_TIME_MS ) ) + { + // Go idle + dryBiCartFillRequested.data = FALSE; + // for this request override also cleared + dryBiCartFillRequested.ovData = FALSE; + state = DRY_BICART_START_STATE; + } return state; } Index: firmware/App/Modes/ModePreGenDialysate.c =================================================================== diff -u -r89c8709e3b27648926fbb20f25c9a67cbeb99adc -rf031f37d3f9985c1224472f2827cd180287c5621 --- firmware/App/Modes/ModePreGenDialysate.c (.../ModePreGenDialysate.c) (revision 89c8709e3b27648926fbb20f25c9a67cbeb99adc) +++ firmware/App/Modes/ModePreGenDialysate.c (.../ModePreGenDialysate.c) (revision f031f37d3f9985c1224472f2827cd180287c5621) @@ -266,7 +266,7 @@ //TODO: Change to wet self test state later DD_PRE_GEN_DIALYSATE_STATE_T state = DD_PRE_GEN_DRY_BICART_FILL_CHECK; - if ( getTestConfigStatus( TEST_CONFIG_DD_ENABLE_DRY_BICART_FILL ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_ENABLE_DRY_BICARB ) == TRUE ) { setBicartFillRequested();