Index: firmware/App/Modes/FPModes/FPModeFault.c =================================================================== diff -u -rd79faa7118db6d048ce3433224b3e5a478c97a98 -r3e1af7cc2576e347ab8bdf2f400196b2301def07 --- firmware/App/Modes/FPModes/FPModeFault.c (.../FPModeFault.c) (revision d79faa7118db6d048ce3433224b3e5a478c97a98) +++ firmware/App/Modes/FPModes/FPModeFault.c (.../FPModeFault.c) (revision 3e1af7cc2576e347ab8bdf2f400196b2301def07) @@ -1,17 +1,17 @@ /************************************************************************** * -* Copyright (c) 2024-2024 Diality Inc. - All Rights Reserved. +* Copyright (c) 2025-2026 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 FPModeFault.c * -* @author (last) Michael Garthwaite -* @date (last) 28-Feb-2025 +* @author (last) Raghu Kallala +* @date (last) 31-Mar-2026 * * @author (original) Michael Garthwaite -* @date (original) 28-Feb-2025 +* @date (original) 08-Sep-2025 * ***************************************************************************/ @@ -299,11 +299,74 @@ } } } - // Defeatured System. Only have m4 to control + // Defeatured System. Only have m4 and m12 to control else { - setValveState( M4_VALV, VALVE_STATE_CLOSED); + setValveState( M4_VALV, VALVE_STATE_CLOSED ); + setValveState( M12_VALV, VALVE_STATE_CLOSED ); } } + +/************************************************************************* + * TEST SUPPORT FUNCTIONS + *************************************************************************/ + + +/*********************************************************************//** + * @brief + * The testValidateFaultChangeReq function validate whether + * requested sub mode change 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 testValidateFaultChangeReq( U32 newSubMode ) +{ + BOOL result = FALSE; + + if ( newSubMode < NUM_OF_FP_FAULT_STATES ) + { + switch ( newSubMode ) + { + case FP_FAULT_STATE_START: + case FP_FAULT_DEENERGIZED_STATE: + case FP_FAULT_ENERGIZED_STATE: + default: + result = TRUE; + break; + } + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testSignalNewFaultSubMode function requests transition + * to a new fault sub mode. + * @details \b Inputs: none + * @details \b Outputs: faultState + * @param newSubMode the enumerated sub state of the mode. + * @return none + *************************************************************************/ +void testSignalNewFaultSubMode( U32 newSubMode ) +{ + if ( newSubMode < NUM_OF_FP_FAULT_STATES ) + { + faultState = (FP_FAULT_STATE_T)newSubMode; + // handle the prerequisite if any + switch ( newSubMode ) + { + // Any of these state require no special handling + case FP_FAULT_STATE_START: + case FP_FAULT_DEENERGIZED_STATE: + case FP_FAULT_ENERGIZED_STATE: + default: + break; + } + } +} + /**@}*/