Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r79c2105d7ec35f3caeb977f6e2cc1b494853d211 -rdb8ff28e816a37e033e36b76ab5949be78114125 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 79c2105d7ec35f3caeb977f6e2cc1b494853d211) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision db8ff28e816a37e033e36b76ab5949be78114125) @@ -23,6 +23,7 @@ #include "ModeTxParams.h" #include "ModeStandby.h" #include "OperationModes.h" +#include "SystemCommTD.h" /** * @addtogroup TDStandbyMode @@ -71,7 +72,7 @@ // Re-initialize when transitioning to standby mode initStandbyMode(); - initDDInterface(); + resetDDInterface(); setCurrentSubState( NO_SUB_STATE ); // Set user alarm recovery actions allowed in this mode @@ -203,7 +204,7 @@ static TD_STANDBY_STATE_T handleStandbyModeWaitForTreatmentState( void ) { TD_STANDBY_STATE_T state = STANDBY_WAIT_FOR_TREATMENT_STATE; -// DG_OP_MODE_T dgOperationMode = getDDOpMode(); + DD_OP_MODE_T ddOperationMode = getDDOpMode(); // switch ( dgOperationMode ) // { @@ -293,6 +294,16 @@ { rejReason = REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE; } + // Verify DD is communicating with HD + else if ( isDDCommunicating() != TRUE ) + { + rejReason = REQUEST_REJECT_REASON_DD_COMM_LOST; + } + // Verify DD is not busy + else if ( ( DD_MODE_STAN != getDDOpMode() ) || ( DD_STANDBY_MODE_STATE_IDLE != getDDSubMode() ) ) // || ( isDDPOSTPassed() != TRUE ) ) + { + rejReason = REQUEST_REJECT_REASON_DD_NOT_IN_STANDBY_IDLE_STATE; + } else { // If request to start treatment not rejected, set flag to initiate treatment workflow