Index: firmware/App/Modes/ModeFill.c =================================================================== diff -u -r9aacc7bb8138bd2b2485bf628592e845ddf6d400 -r35a1f7d58d013f95108e38674b01a283970e74a2 --- firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 9aacc7bb8138bd2b2485bf628592e845ddf6d400) +++ firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 35a1f7d58d013f95108e38674b01a283970e74a2) @@ -234,17 +234,17 @@ U32 transitionToFillMode( void ) { F32 targetFlowLPM = getTargetFillFlowRateLPM(); - DG_FILL_MODE_STATE_T restoreFillState = fillState; ///< Last active fill state. - initFillMode(); // Reset the state machine - if ( ( getTestConfigStatus( TEST_CONFIG_RECOVER_TREATMENT ) != TRUE ) || ( getPreviousOperationMode() != DG_MODE_FAUL ) ) - { - setCurrentSubState( NO_SUB_STATE ); - // Set initial actuator states - setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); - setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); - } - else + initFillMode(); + setCurrentSubState( NO_SUB_STATE ); + // Set initial actuator states + setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); + setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); +#ifdef 0 + // Reset the state machine + // Note: the substate timers, and operation flags need to be reset on recovery, consider + // reinitializing the state variables, the resetting the state, by calling setModeFillStateTransition() + if ( ( TRUE == getTestConfigStatus( TEST_CONFIG_RECOVER_TREATMENT ) ) && ( DG_MODE_FAUL == getPreviousOperationMode() ) ) { // Restore the prior fillstate to a valid, running fill state, with timer state reset. fillState = restoreFillState; @@ -301,16 +301,11 @@ case DG_FILL_MODE_STATE_PAUSED: targetFlowLPM = TARGET_RO_FLOW_RATE_IN_PAUSE_L; dialysatePauseStartTimeMS = getMSTimerCount(); - // clear max fill time tracking - dialysatePauseElapsedTimeMS = 0; - dialysatePauseStartTimeMS = 0; - didFillRecoverFromPause = TRUE; break; } } - +#endif getFillChemicalCondRecord( &chemicalsCond ); - turnOnUVReactor( INLET_UV_REACTOR ); turnOnUVReactor( OUTLET_UV_REACTOR );