Index: firmware/App/Modes/ModePreTreat.c =================================================================== diff -u -r00fc3c7eac99970ae11dffe12d5432d6bcf5c92d -r7229fed020e9f3398bd5ccc8a3f5576cedc322b0 --- firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision 00fc3c7eac99970ae11dffe12d5432d6bcf5c92d) +++ firmware/App/Modes/ModePreTreat.c (.../ModePreTreat.c) (revision 7229fed020e9f3398bd5ccc8a3f5576cedc322b0) @@ -700,7 +700,7 @@ patientConnectionConfirm = FALSE; treatmentStartRequested = FALSE; - doorClosedRequired( FALSE, TRUE ); + doorClosedRequired( TRUE, TRUE ); for ( valve = VDI; valve < NUM_OF_VALVES; ++valve ) { @@ -1003,26 +1003,47 @@ /*********************************************************************//** * @brief + * The handlePatientConnectionDoorOpened function handles the check + * for door opened in pre-treatment patient connection + * sub-mode. + * @details Inputs: none + * @details Outputs: doorOpened + * @return none + *************************************************************************/ +static void handlePatientConnectionDoorOpened( void ) +{ + // Look for cartridge door to open (indicating user inverting dialyzer) + if ( STATE_OPEN == getSwitchStatus( FRONT_DOOR ) ) + { + doorOpened = TRUE; + cmdStopDGTrimmerHeater(); + signalDialInPumpHardStop(); + } + else + { + setDialInPumpTargetFlowRate( DIP_PATIENT_CONNECTION_FLOW_RATE_ML_MIN, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); + cmdStartDGTrimmerHeater(); + } +} + +/*********************************************************************//** + * @brief * The handlePatientConnectionWait4UFVolState function handles the wait * for ultrafiltration volume setting state of pre-treatment patient connection * sub-mode. * @details Inputs: setUFVolStatus - * @details Outputs: setUFVolStatus, doorOpened + * @details Outputs: setUFVolStatus * @return next patient connection state *************************************************************************/ static HD_PRE_TREATMENT_PAT_CONN_STATE_T handlePatientConnectionWait4UFVolState( void ) { HD_PRE_TREATMENT_PAT_CONN_STATE_T nextState = PRE_TREATMENT_PAT_CONN_WAIT_FOR_UF_VOL_STATE; - // Look for cartridge door to open (indicating user inverting dialyzer) - if ( STATE_OPEN == getSwitchStatus( FRONT_DOOR ) ) - { - doorOpened = TRUE; - } // If UF volume set by user, move on to next state if ( TRUE == setUFVolStatus ) { setUFVolStatus = FALSE; + doorClosedRequired( FALSE, TRUE ); nextState = PRE_TREATMENT_PAT_CONN_WAIT_FOR_DLZR_INVERT_STATE; } @@ -1035,18 +1056,16 @@ * for dialyzer invert confirmation state of pre-treatment patient connection * sub-mode. * @details Inputs: doorOpened - * @details Outputs: doorOpened + * @details Outputs: none * @return next patient connection state *************************************************************************/ static HD_PRE_TREATMENT_PAT_CONN_STATE_T handlePatientConnectionWait4DialyzerInvertState( void ) { HD_PRE_TREATMENT_PAT_CONN_STATE_T nextState = PRE_TREATMENT_PAT_CONN_WAIT_FOR_DLZR_INVERT_STATE; // Look for cartridge door to open and then close (indicating user inverted dialyzer) - if ( STATE_OPEN == getSwitchStatus( FRONT_DOOR ) ) - { - doorOpened = TRUE; - } + handlePatientConnectionDoorOpened(); + if ( ( TRUE == doorOpened ) && ( STATE_CLOSED == getSwitchStatus( FRONT_DOOR ) ) ) { nextState = PRE_TREATMENT_PAT_CONN_WAIT_FOR_USER_CONFIRM_STATE; @@ -1068,10 +1087,16 @@ { HD_PRE_TREATMENT_PAT_CONN_STATE_T nextState = PRE_TREATMENT_PAT_CONN_WAIT_FOR_USER_CONFIRM_STATE; + // Look for cartridge door to open and then close (indicating user inverted dialyzer) + handlePatientConnectionDoorOpened(); + if ( TRUE == patientConnectionConfirm ) { doorClosedRequired( TRUE, TRUE ); - nextState = PRE_TREATMENT_PAT_CONN_WAIT_FOR_TREATMENT_START_STATE; + if ( STATE_CLOSED == getSwitchStatus( FRONT_DOOR ) ) + { + nextState = PRE_TREATMENT_PAT_CONN_WAIT_FOR_TREATMENT_START_STATE; + } } return nextState; Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -rf53ecc014c076fc476e7963b67d688b7233579ee -r7229fed020e9f3398bd5ccc8a3f5576cedc322b0 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision f53ecc014c076fc476e7963b67d688b7233579ee) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 7229fed020e9f3398bd5ccc8a3f5576cedc322b0) @@ -71,6 +71,7 @@ static OVERRIDE_U32_T standbyModePublishInterval = { DISINFECTS_DATA_PUB_INTERVAL, DISINFECTS_DATA_PUB_INTERVAL, DISINFECTS_DATA_PUB_INTERVAL, 0 }; static const U32 SERVICE_TIME_INTERVAL_S = (U32)( 365 * 0.5 * SECONDS_IN_A_DAY ); ///< HD/DG 6-month service interval in seconds. +static BOOL homingInitiated; ///< Flag indicates actuator homing has been initiated from standby mode. // ********** private function prototypes ********** Index: firmware/App/Modes/SelfTests.c =================================================================== diff -u -rf53ecc014c076fc476e7963b67d688b7233579ee -r7229fed020e9f3398bd5ccc8a3f5576cedc322b0 --- firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision f53ecc014c076fc476e7963b67d688b7233579ee) +++ firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision 7229fed020e9f3398bd5ccc8a3f5576cedc322b0) @@ -7,8 +7,8 @@ * * @file SelfTests.c * -* @author (last) Dara Navaei -* @date (last) 09-May-2023 +* @author (last) Sean Nash +* @date (last) 15-May-2023 * * @author (original) Quang Nguyen * @date (original) 28-Jan-2021 @@ -1484,7 +1484,7 @@ if ( TRUE == didTimeout( syringeOcclusionDelayStartTime, SYRINGE_PUMP_OCCLUSION_CHECK_DELAY ) ) { - if ( FALSE == checkForSyringeOcclusion() ) // transition to complete state only when occlusion is removed + if ( FALSE == checkForSyringeOcclusion( FALSE ) ) // transition to complete state only when occlusion is removed { state = DRY_SELF_TESTS_COMPLETE_STATE; } Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r533ecbb65cdd2d1c993bccae018223c0e8a6d55b -r7229fed020e9f3398bd5ccc8a3f5576cedc322b0 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 533ecbb65cdd2d1c993bccae018223c0e8a6d55b) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 7229fed020e9f3398bd5ccc8a3f5576cedc322b0) @@ -5353,6 +5353,7 @@ if ( sizeof( TEST_OVERRIDE_PAYLOAD_T ) == message->hdr.payloadLen ) { memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_PAYLOAD_T ) ); + if ( FALSE == payload.reset ) { result = testSetBatteryRemainingCapacityOverride( payload.state.f32 ); Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r533ecbb65cdd2d1c993bccae018223c0e8a6d55b -r7229fed020e9f3398bd5ccc8a3f5576cedc322b0 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 533ecbb65cdd2d1c993bccae018223c0e8a6d55b) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 7229fed020e9f3398bd5ccc8a3f5576cedc322b0) @@ -924,9 +924,6 @@ // MSG_ID_HD_SEND_BLOOD_LEAK_EMB_MODE_RESPONSE BOOL sendBloodLeakEmbeddedModeCommandResponse( U08 cmd, U32 responseLen, U08* response ); -// MSG_ID_HD_SEND_ALARMS_COMMAND -void handleResendAllAlarmsCommand( MESSAGE_T* message ); - // MSG_ID_HD_BLOOD_PUMP_SET_PWM void handleTestBloodPumpSetPWM( MESSAGE_T* message );