Index: firmware/App/Modes/ModePreTreat.c =================================================================== diff -u -rb74d08ff24839ebbea51582772ed2b9588558ea0 -r3f53d4aaf8840366306a6143eda9abf1a763bb73 --- firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision b74d08ff24839ebbea51582772ed2b9588558ea0) +++ firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision 3f53d4aaf8840366306a6143eda9abf1a763bb73) @@ -18,7 +18,7 @@ #include "Buttons.h" #include "ModePreTreat.h" #include "OperationModes.h" -#include "StateServices/TubeSetInstall.h" +#include "TubeSetInstall.h" #include "Timers.h" #include "TxParams.h" @@ -30,6 +30,7 @@ // ********** private definitions ********** static TD_PRE_TREATMENT_MODE_STATE_T currentPreTreatmentState; ///< Current Pre-Treatment sub-state +static BOOL goToInstallStateRequested; ///< Flag indicating a request to transition to Install state. // ********** private function prototypes ********** @@ -55,7 +56,8 @@ { // Start a fresh Treatment Parameters session for this run. resetTreatmentParameters(); - currentPreTreatmentState = TD_PRE_TREATMENT_TUBING_SET_INSTALL_STATE; + currentPreTreatmentState = TD_PRE_TREATMENT_TUBING_SET_INSTALL_STATE; + goToInstallStateRequested = FALSE; } /*********************************************************************//** @@ -231,6 +233,13 @@ { TD_PRE_TREATMENT_MODE_STATE_T state = TD_PRE_TREATMENT_SELF_TEST_DRY_STATE; + if ( TRUE == goToInstallStateRequested ) + { + goToInstallStateRequested = FALSE; + initTubeSetInstall(); + state = TD_PRE_TREATMENT_TUBING_SET_INSTALL_STATE; + } + // TODO: Transition to Prime state on completion when implemented // state = TD_PRE_TREATMENT_PRIME_STATE; @@ -317,16 +326,15 @@ /*********************************************************************//** * @brief - * The signalGoToInstallState function resets the Tube Set Install Service - * and set the current state of pre-treatment to install state. + * The signalGoToInstallState function signals a request to transition + * the Pre-Treatment mode state machine to Install state. * @details Inputs: none - * @details Outputs: currentPreTreatmentState, initTubeSetInstall() + * @details Outputs: goToInstallStateRequested * @return none *************************************************************************/ void signalGoToInstallState( void ) { - initTubeSetInstall(); - currentPreTreatmentState = TD_PRE_TREATMENT_TUBING_SET_INSTALL_STATE; + goToInstallStateRequested = TRUE; } /**@}*/