Index: firmware/App/Modes/ModeFault.c =================================================================== diff -u -r6d0bd19fb192dcd272fa773e8833862cc8a8f750 -rae3a2d3b6952e59cdf469d48e9f4c26574564eff --- firmware/App/Modes/ModeFault.c (.../ModeFault.c) (revision 6d0bd19fb192dcd272fa773e8833862cc8a8f750) +++ firmware/App/Modes/ModeFault.c (.../ModeFault.c) (revision ae3a2d3b6952e59cdf469d48e9f4c26574564eff) @@ -7,8 +7,8 @@ * * @file ModeFault.c * -* @author (last) Arpita Srivastava -* @date (last) 10-Mar-2026 +* @author (last) Raghu Kallala +* @date (last) 22-Apr-2026 * * @author (original) Vinayakam Mani * @date (original) 07-Aug-2024 @@ -22,6 +22,7 @@ #include "ModeFault.h" #include "Messaging.h" #include "OperationModes.h" +#include "RinsePump.h" #include "SafetyShutdown.h" #include "Utilities.h" #include "Valves.h" @@ -203,6 +204,7 @@ requestConcentratePumpOff( D76_PUMP, parkPumps ); signalDialysatePumpHardStop( D12_PUMP ); signalDialysatePumpHardStop( D48_PUMP ); + setRinsePumpState( RINSE_PUMP_STATE_OFF ); stopHeater( D5_HEAT ); stopHeater( D45_HEAT ); } @@ -251,6 +253,7 @@ requestConcentratePumpOff( D76_PUMP, parkPumps ); signalDialysatePumpHardStop( D12_PUMP ); signalDialysatePumpHardStop( D48_PUMP ); + setRinsePumpState( RINSE_PUMP_STATE_OFF ); stopHeater( D5_HEAT ); stopHeater( D45_HEAT ); } @@ -381,4 +384,68 @@ return state; } + +/************************************************************************* + * TEST SUPPORT FUNCTIONS + *************************************************************************/ + + +/*********************************************************************//** + * @brief + * The testValidateDDFaultChangeReq function validate whether request + * operation sub mode is legal or not. + * @details \b Inputs: none + * @details \b Outputs: none + * @param newSubMode the enumerated sub state of the mode + * @return TRUE if request is legal, FALSE if not + *************************************************************************/ +BOOL testValidateDDFaultChangeReq( U32 newSubMode ) +{ + BOOL result = FALSE; + + if ( newSubMode < NUM_OF_DD_FAULT_STATES ) + { + switch ( newSubMode ) + { + case DD_FAULT_STATE_START: + case DD_FAULT_DEENERGIZED_STATE: + case DD_FAULT_ENERGIZED_STATE: + result = TRUE; + break; + + default: + break; + } + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testSignalNewDDFaultSubMode function request transition to a + * new operation sub mode. + * @details \b Inputs: none + * @details \b Outputs: faultState + * @param newSubMode the enumerated sub state of the mode + * @return none + *************************************************************************/ +void testSignalNewDDFaultSubMode( U32 newSubMode ) +{ + if ( newSubMode < NUM_OF_DD_FAULT_STATES ) + { + faultState = (DD_FAULT_STATE_T)newSubMode; + + switch ( newSubMode ) + { + // Any of these state require no special handling + case DD_FAULT_STATE_START: + case DD_FAULT_DEENERGIZED_STATE: + case DD_FAULT_ENERGIZED_STATE: + default: + break; + } + } +} + /**@}*/