Index: firmware/App/Controllers/BloodLeak.c =================================================================== diff -u -r41a41275952290677df1fb0d27db3f354be26dd8 -r9324981b9eeeb2735a379019acc8f7184023460b --- firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision 41a41275952290677df1fb0d27db3f354be26dd8) +++ firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision 9324981b9eeeb2735a379019acc8f7184023460b) @@ -346,7 +346,8 @@ break; default: - // TODO software fault + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_BLOOD_LEAK_EMBEDDED_MODE_INVALID_STATE ) + bloodLeakEmbModeSubstate = BLOOD_LEAK_EMB_MODE_WAIT_FOR_COMAND_STATE; break; } } Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r41a41275952290677df1fb0d27db3f354be26dd8 -r9324981b9eeeb2735a379019acc8f7184023460b --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 41a41275952290677df1fb0d27db3f354be26dd8) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 9324981b9eeeb2735a379019acc8f7184023460b) @@ -79,8 +79,6 @@ // ********** private function prototypes ********** -static void handleDisinfectCancel( BOOL stop ); - static HD_STANDBY_STATE_T handleStandbyModeStartState( void ); static HD_STANDBY_STATE_T handleStandbyModeWaitForTreatmentState( void ); static HD_STANDBY_STATE_T handleStandbyModeWaitForDisinfectState( void ); @@ -89,6 +87,7 @@ static HD_STANDBY_STATE_T handleStandbyModeWaitForDGCleaningModeStartState( void ); static HD_STANDBY_STATE_T handleStandbyModeDGCleaningModeInProgressState( void ); +static void handleDisinfectCancel( BOOL stop ); static void setRequestedCleaningMode( DG_OP_MODE_T opMode ); static void clearCurrentCleaningModeStatus( void ); static void handleChemFlushSampleCollection( void ); @@ -586,79 +585,6 @@ /*********************************************************************//** * @brief - * The handleDisinfectCancel function handles - * DG disinfect cancel UI interaction. - * @details Inputs: none - * @details Outputs: none - * @param stop button status - * @return none - *************************************************************************/ -static void handleDisinfectCancel( BOOL stop ) -{ - CONFIRMATION_REQUEST_STATUS_T confirm_status; - - if ( STANDBY_CLEANING_MODE_IN_PROGRESS_STATE == currentStandbyState ) - { - if ( ( TRUE == stop ) && ( GENERIC_CONFIRM_ID_NONE == disinfectCancelReqID ) ) - { - disinfectCancelReqID = addConfirmationRequest( currentDGCleaningMode.stopRequestCmdID, GENERIC_CONFIRM_CMD_REQUEST_OPEN, 0 ); - } - else if ( disinfectCancelReqID != GENERIC_CONFIRM_ID_NONE ) - { - // Get the confirmation request. It consumes the request if completed and responds to UI. - confirm_status = getConfirmationRequestStatus( disinfectCancelReqID ); - switch ( confirm_status ) - { - case CONFIRMATION_REQUEST_STATUS_ACCEPTED: - // Clear request active status - disinfectCancelReqID = GENERIC_CONFIRM_ID_NONE; - - switch ( currentDGCleaningMode.dgOpMode ) - { - case DG_MODE_FLUS: - cmdStopDGFlush(); - break; - - case DG_MODE_HEAT: - cmdStopDGHeatDisinfect(); - break; - - case DG_MODE_CHEM: - cmdStopDGChemicalDisinfect(); - break; - - case DG_MODE_CHFL: - cmdStopDGChemFlushDisinfect(); - break; - - case DG_MODE_HCOL: - cmdStopDGActiveCool(); - break; - - case DG_MODE_ROPS: - cmdStopDGROPermeateSampleMode(); - break; - } - break; - - case CONFIRMATION_REQUEST_STATUS_TIMEOUT: - case CONFIRMATION_REQUEST_STATUS_REJECTED: - // Clear request active status - disinfectCancelReqID = GENERIC_CONFIRM_ID_NONE; - break; - - case CONFIRMATION_REQUEST_STATUS_PENDING: - case CONFIRMATION_REQUEST_STATUS_UNUSED: - default: - // Nothing to do - break; - } - } - } -} - -/*********************************************************************//** - * @brief * The handleStandbyModeStartState function handles the standby start state. * This state waits for the door to be closed and then initiates homing of * pumps and valves and transitions to the wait for treatment state. @@ -912,6 +838,79 @@ /*********************************************************************//** * @brief + * The handleDisinfectCancel function handles + * DG disinfect cancel UI interaction. + * @details Inputs: none + * @details Outputs: none + * @param stop button status + * @return none + *************************************************************************/ +static void handleDisinfectCancel( BOOL stop ) +{ + CONFIRMATION_REQUEST_STATUS_T confirm_status; + + if ( STANDBY_CLEANING_MODE_IN_PROGRESS_STATE == currentStandbyState ) + { + if ( ( TRUE == stop ) && ( GENERIC_CONFIRM_ID_NONE == disinfectCancelReqID ) ) + { + disinfectCancelReqID = addConfirmationRequest( currentDGCleaningMode.stopRequestCmdID, GENERIC_CONFIRM_CMD_REQUEST_OPEN, 0 ); + } + else if ( disinfectCancelReqID != GENERIC_CONFIRM_ID_NONE ) + { + // Get the confirmation request. It consumes the request if completed and responds to UI. + confirm_status = getConfirmationRequestStatus( disinfectCancelReqID ); + switch ( confirm_status ) + { + case CONFIRMATION_REQUEST_STATUS_ACCEPTED: + // Clear request active status + disinfectCancelReqID = GENERIC_CONFIRM_ID_NONE; + + switch ( currentDGCleaningMode.dgOpMode ) + { + case DG_MODE_FLUS: + cmdStopDGFlush(); + break; + + case DG_MODE_HEAT: + cmdStopDGHeatDisinfect(); + break; + + case DG_MODE_CHEM: + cmdStopDGChemicalDisinfect(); + break; + + case DG_MODE_CHFL: + cmdStopDGChemFlushDisinfect(); + break; + + case DG_MODE_HCOL: + cmdStopDGActiveCool(); + break; + + case DG_MODE_ROPS: + cmdStopDGROPermeateSampleMode(); + break; + } + break; + + case CONFIRMATION_REQUEST_STATUS_TIMEOUT: + case CONFIRMATION_REQUEST_STATUS_REJECTED: + // Clear request active status + disinfectCancelReqID = GENERIC_CONFIRM_ID_NONE; + break; + + case CONFIRMATION_REQUEST_STATUS_PENDING: + case CONFIRMATION_REQUEST_STATUS_UNUSED: + default: + // Nothing to do + break; + } + } + } +} + +/*********************************************************************//** + * @brief * The setRequestedCleaningMode function sets the variables for the requested * DG cleaning mode. * @details Inputs: currentDGCleaningMode @@ -992,6 +991,7 @@ currentDGCleaningMode.sampleRequestID = GENERIC_CONFIRM_ID_NONE; currentDGCleaningMode.stopRequestCmdID = GENERIC_CONFIRM_ID_NONE; } + /*********************************************************************//** * @brief * The handleChemFlushSampleCollection function handle the chemical disinfect Index: firmware/App/Services/AlarmMgmtSWFaults.h =================================================================== diff -u -ra7821aff3dc204a060233b0753253ec04d020557 -r9324981b9eeeb2735a379019acc8f7184023460b --- firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision a7821aff3dc204a060233b0753253ec04d020557) +++ firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision 9324981b9eeeb2735a379019acc8f7184023460b) @@ -185,6 +185,7 @@ SW_FAULT_ID_DIALYSIS_INVALID_DIALYZER_REPRIME_STATE, SW_FAULT_ID_HD_INVALID_PRE_TREATMENT_PAT_CONN_STATE, // 155 SW_FAULT_ID_PRES_LIMITS_INVALID_STATE, + SW_FAULT_ID_BLOOD_LEAK_EMBEDDED_MODE_INVALID_STATE, NUM_OF_SW_FAULT_IDS } SW_FAULT_ID_T;