Index: firmware/App/Modes/TreatmentRecirc.c =================================================================== diff -u -rb73ca202edeef9c43966f32fcab31ef8743398fe -rcd5be724d5a3ba7457e761191d82f278654d7f5c --- firmware/App/Modes/TreatmentRecirc.c (.../TreatmentRecirc.c) (revision b73ca202edeef9c43966f32fcab31ef8743398fe) +++ firmware/App/Modes/TreatmentRecirc.c (.../TreatmentRecirc.c) (revision cd5be724d5a3ba7457e761191d82f278654d7f5c) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2021-2023 Diality Inc. - All Rights Reserved. +* Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file TreatmentRecirc.c * * @author (last) Sean Nash -* @date (last) 21-Apr-2023 +* @date (last) 31-Jul-2023 * * @author (original) Sean Nash * @date (original) 20-Jan-2021 @@ -67,7 +67,6 @@ static BOOL handleRecircReconnectUserAction( REQUEST_REJECT_REASON_CODE_T *rejReason ); static BOOL handleRecicConfirmReconnectUserAction( REQUEST_REJECT_REASON_CODE_T *rejReason ); static BOOL handleRecircResumeUserAction( REQUEST_REJECT_REASON_CODE_T *rejReason ); -static BOOL handleRecircEndTreatmentUserAction( REQUEST_REJECT_REASON_CODE_T *rejReason ); static BOOL handleRecircConfirmDisconnectUserAction( REQUEST_REJECT_REASON_CODE_T *rejReason ); static void publishTreatmentRecircData( void ); @@ -115,14 +114,17 @@ void transitionToTreatmentRecirc( void ) { initTreatmentRecirc(); - + setCurrentSubState( (U32)treatmentRecircState ); doorClosedRequired( TRUE, TRUE ); // Set valves to safe state setValvePosition( VDI, VALVE_POSITION_C_CLOSE ); setValvePosition( VDO, VALVE_POSITION_C_CLOSE ); setupForRecirculationStopState(); + // Enable venous bubble detection while recirculating + setVenousBubbleDetectionEnabled( TRUE ); + // Ensure syringe pump is stopped stopSyringePump(); // Stop air trap leveling control @@ -178,7 +180,7 @@ * The execTreatmentRecirc function executes the Treatment circulate sub-mode * state machine. * @details Inputs: treatmentRecircState - * @details Outputs: treatmentRecircState, recircTimerCtr + * @details Outputs: treatmentRecircState, recircTimerCtr, recircEndTreatmentRequested * @return none *************************************************************************/ void execTreatmentRecirc( void ) @@ -213,6 +215,7 @@ if ( priorSubState != treatmentRecircState ) { + setCurrentSubState( (U32)treatmentRecircState ); SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_SUB_STATE_CHANGE, priorSubState, treatmentRecircState ); } // Re-circulate flags should be handled by now - reset in case not handled by current state @@ -369,7 +372,9 @@ break; case REQUESTED_USER_ACTION_TX_RECIRC_END_TREATMENT: - accepted = handleRecircEndTreatmentUserAction( &rejReason ); + // Send message to UI to get user confirmation to end treatment - action initiated only upon receipt of user confirmation from UI + addConfirmationRequest( GENERIC_CONFIRM_ID_TREATMENT_END, GENERIC_CONFIRM_CMD_REQUEST_OPEN, 0 ); + accepted = TRUE; break; case REQUESTED_USER_ACTION_TX_RECIRC_CONFIRM_DISCONNECT: @@ -477,26 +482,6 @@ /*********************************************************************//** * @brief - * The handleRecircEndTreatmentUserAction function handles an end treatment - * user action request. It is assumed that the calling function will set - * the reject reason parameter to None beforehand. - * @details Inputs: treatmentRecircState - * @details Outputs: ending of treatment action handled - * @param rejReason Code indicating reason for rejection - * @return TRUE if user action accepted, FALSE if not - *************************************************************************/ -static BOOL handleRecircEndTreatmentUserAction( REQUEST_REJECT_REASON_CODE_T *rejReason ) -{ - BOOL result = FALSE; - - result = TRUE; - recircEndTreatmentRequested = TRUE; - - return result; -} - -/*********************************************************************//** - * @brief * The handleRecircConfirmDisconnectUserAction function handles a confirm * patient disconnect user action request. It is assumed that the calling * function will set the reject reason parameter to None beforehand.