Index: firmware/App/Modes/ModePreGenDialysate.c =================================================================== diff -u -rbd522c8ffdf75130571e5b6a79d1b1d6acd78b1c -r57bbf4b3e97f2c3e966eb1305aa30395ea61897d --- firmware/App/Modes/ModePreGenDialysate.c (.../ModePreGenDialysate.c) (revision bd522c8ffdf75130571e5b6a79d1b1d6acd78b1c) +++ firmware/App/Modes/ModePreGenDialysate.c (.../ModePreGenDialysate.c) (revision 57bbf4b3e97f2c3e966eb1305aa30395ea61897d) @@ -42,13 +42,15 @@ #define PRE_GEN_DIALYSATE_DATA_PUB_INTERVAL ( 250 / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the pre-gen dialysate mode data published. #define HYD_CHAMBER_PRES_CHECK_TIME_OUT ( 30 * MS_PER_SECOND ) ///< Time out period when hydraulics chamber pressure check initiated #define NEG_PRES_PERSISTENCE_TIME_MS ( 1 * MS_PER_SECOND ) ///< Persistence time for Hydraulics chamber negative degassing pressure check. +#define DRY_BICART_INITIAL_FILL_REQUEST_TIME_MS ( 150 / TASK_GENERAL_INTERVAL ) ///< Wait time for the initial fill request // ********** private data ********** static DD_PRE_GEN_DIALYSATE_STATE_T preGenDialysateState; ///< Currently active pre-gen dialysate state. static DD_WET_SELF_TEST_STATE_T wetSelfTestState; ///< Currently active pre-gen Wet self test state. static U32 hydChamberPressureCheckStartTimeMS; ///< Current time when hydraulics chamber pressure check started in milliseconds. static U32 pressureCheckPersistanceStartTimeMS; ///< Current time for pressure check persistance time started in milliseconds. +static U32 dryBiCartInitialFillRequestStartTime; ///< Drybicart Initial Fill request wait time static BOOL pendingStartDDGenDialRequest; ///< Flag indicating TD has requested DD start the generation dialysate request. static BOOL pendingStopDDPreGenDialRequest; ///< Flag indicating TD has requested DD stop the pre generation dialysate. static U32 preGenDialysatePublishTimerCounter; ///< Pre-Gen Dialysate data broadcast timer counter used to schedule when to transmit data. @@ -81,6 +83,7 @@ wetSelfTestState = DD_WET_SELF_TEST_START; hydChamberPressureCheckStartTimeMS = 0; pressureCheckPersistanceStartTimeMS = 0; + dryBiCartInitialFillRequestStartTime = 0; pendingStartDDGenDialRequest = FALSE; pendingStopDDPreGenDialRequest = FALSE; preGenDialysateModePublishInterval.data = PRE_GEN_DIALYSATE_DATA_PUB_INTERVAL; @@ -273,10 +276,11 @@ //TODO: Change to wet self test state later DD_PRE_GEN_DIALYSATE_STATE_T state = DD_PRE_GEN_DRY_BICART_INITIAL_FILL; - if ( FALSE == getTestConfigStatus( TEST_CONFIG_DD_DISABLE_DRY_BICARB ) ) + // need to wait for valve actuation from Idle state to Fill water state since starting and end state is Idle state + if ( ( FALSE == getTestConfigStatus( TEST_CONFIG_DD_DISABLE_DRY_BICARB ) ) && ( TRUE == didTimeout( dryBiCartInitialFillRequestStartTime, DRY_BICART_INITIAL_FILL_REQUEST_TIME_MS ) ) ) { // stay in this state till bicart fill complete. - if ( getCurrentDryBiCartFillExecState() == DRY_BICART_FILL_COMPLETE_STATE ) + if ( getCurrentDryBiCartFillExecState() == DRY_BICARBONATE_FILL_CARTRIDGE_STATE_IDLE ) { state = DD_PRE_GEN_DIALYSATE_WAIT_FOR_GEND; }