Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -r42db67ae5e0568843ec1b8c4733d1279ea2d6169 -rd7e01dce5b2ebb1ea02832a9ced81550a919b67b --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 42db67ae5e0568843ec1b8c4733d1279ea2d6169) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision d7e01dce5b2ebb1ea02832a9ced81550a919b67b) @@ -7,8 +7,8 @@ * * @file DialInFlow.c * -* @author (last) Dara Navaei -* @date (last) 22-Feb-2022 +* @author (last) Darren Cox +* @date (last) 10-Mar-2022 * * @author (original) Sean * @date (original) 16-Dec-2019 Index: firmware/App/Controllers/DialOutFlow.c =================================================================== diff -u -r42db67ae5e0568843ec1b8c4733d1279ea2d6169 -rd7e01dce5b2ebb1ea02832a9ced81550a919b67b --- firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision 42db67ae5e0568843ec1b8c4733d1279ea2d6169) +++ firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision d7e01dce5b2ebb1ea02832a9ced81550a919b67b) @@ -7,8 +7,8 @@ * * @file DialOutFlow.c * -* @author (last) Dara Navaei -* @date (last) 22-Feb-2022 +* @author (last) Darren Cox +* @date (last) 10-Mar-2022 * * @author (original) Sean * @date (original) 24-Jan-2020 Index: firmware/App/Modes/ModePostTreat.c =================================================================== diff -u -r95ff25f5260bbd86127eb2d93877fe322e1f0d90 -rd7e01dce5b2ebb1ea02832a9ced81550a919b67b --- firmware/App/Modes/ModePostTreat.c (.../ModePostTreat.c) (revision 95ff25f5260bbd86127eb2d93877fe322e1f0d90) +++ firmware/App/Modes/ModePostTreat.c (.../ModePostTreat.c) (revision d7e01dce5b2ebb1ea02832a9ced81550a919b67b) @@ -8,7 +8,7 @@ * @file ModePostTreat.c * * @author (last) Dara Navaei -* @date (last) 15-Feb-2022 +* @date (last) 31-Mar-2022 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -361,13 +361,24 @@ *************************************************************************/ static HD_POST_TREATMENT_STATE_T handlePostTreatmentPatientDisconnectionState( void ) { - F32 const bolusVol = getTreatmentParameterF32( TREATMENT_PARAM_HEPARIN_BOLUS_VOLUME ); - F32 const hepRate = getTreatmentParameterF32( TREATMENT_PARAM_HEPARIN_BOLUS_VOLUME ); - HD_POST_TREATMENT_STATE_T state = HD_POST_TREATMENT_PATIENT_DISCONNECTION_STATE; VALVE_T valve; - if ( STATE_CLOSED == getFPGADoorState() ) + F32 bolusVol = getTreatmentParameterF32( TREATMENT_PARAM_HEPARIN_BOLUS_VOLUME ); + F32 hepRate = getTreatmentParameterF32( TREATMENT_PARAM_HEPARIN_DISPENSE_RATE ); + HD_POST_TREATMENT_STATE_T state = HD_POST_TREATMENT_PATIENT_DISCONNECTION_STATE; + OPN_CLS_STATE_T frontDoor = getSwitchStatus( FRONT_DOOR ); + OPN_CLS_STATE_T pumpTrack = getSwitchStatus( PUMP_TRACK_SWITCH ); + +#ifndef _RELEASE_ + if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_DISABLE_SWITCHES_MONITOR ) ) { + frontDoor = STATE_CLOSED; + pumpTrack = STATE_CLOSED; + } +#endif + + if ( ( STATE_CLOSED == frontDoor ) && ( STATE_CLOSED == pumpTrack ) ) + { #ifndef _RELEASE_ if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_DISABLE_UI_INTERACTION ) ) #endif @@ -434,7 +445,7 @@ /*********************************************************************//** * @brief * The handlePostTreatmentVerifyState function verifies cartridge removed, - * syringe removed, and doors are closed before transition to standby mode. + * syringe removed before transition to standby mode. * @details Inputs: doors' status, syringe status, occlusion sensors value * @details Outputs: requested transition to standby mode * @return current state (sub-mode) @@ -452,12 +463,10 @@ isCartridgeRemoved = isCartridgeUnloaded(); } - if ( STATE_CLOSED == getFPGADoorState() ) + if ( FALSE == isCartridgeRemoved ) { - if ( FALSE == isCartridgeRemoved ) - { - activateAlarmNoData( ALARM_ID_CARTRIDGE_REMOVAL_FAILURE ); - } + activateAlarmNoData( ALARM_ID_CARTRIDGE_REMOVAL_FAILURE ); + } if ( TRUE == isSyringeDetected() ) { @@ -474,10 +483,11 @@ cmdStopDG(); requestNewOperationMode( MODE_STAN ); } - } - else + // Wait for cartridge and syringe to be removed and for DG to finish any drains/fills. + if ( ( TRUE == isCartridgeRemoved ) && ( FALSE == isSyringeDetected() ) ) { - activateAlarmNoData( ALARM_ID_CARTRIDGE_DOOR_OPENED ); + cmdStopDG(); + requestNewOperationMode( MODE_STAN ); } return HD_POST_TREATMENT_VERIFY_STATE; @@ -592,7 +602,7 @@ } // Drain has started and DG goes to re-circ mode flush lines state means drain completed - if ( ( TRUE == isDrainStarted ) && ( DG_GEN_IDLE_MODE_STATE_FLUSH_LINES == getDGSubMode() ) ) + if ( ( TRUE == isDrainStarted ) && ( DG_GEN_IDLE_MODE_STATE_FLUSH_WATER == getDGSubMode() ) ) { isDrainCompleted = TRUE; } @@ -651,7 +661,7 @@ } // Drain has started and DG goes to generation idle mode flush lines state means drain completed - if ( ( TRUE == isDrainStarted ) && ( DG_GEN_IDLE_MODE_STATE_FLUSH_LINES == getDGSubMode() ) ) + if ( ( TRUE == isDrainStarted ) && ( DG_GEN_IDLE_MODE_STATE_FLUSH_WATER == getDGSubMode() ) ) { isDrainCompleted = TRUE; }