Index: firmware/App/Modes/FPModes/ModeGenPermeate.c =================================================================== diff -u -r973f790125e70115662d979f5f5631bb9df081f0 -r940437fb1298c036eeffbbfc8db1d43195e04927 --- firmware/App/Modes/FPModes/ModeGenPermeate.c (.../ModeGenPermeate.c) (revision 973f790125e70115662d979f5f5631bb9df081f0) +++ firmware/App/Modes/FPModes/ModeGenPermeate.c (.../ModeGenPermeate.c) (revision 940437fb1298c036eeffbbfc8db1d43195e04927) @@ -512,4 +512,59 @@ return result; } +/*********************************************************************//** + * @brief + * The testValidateGenPermeateChangeReq 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 testValidateGenPermeateChangeReq( U32 newSubMode ) +{ + BOOL result = FALSE; + + if ( newSubMode < NUM_OF_FP_GENP_MODE_STATES ) + { + switch ( newSubMode ) + { + case FP_GENP_TANK_FILL_STATE: + case FP_GENP_TANK_FULL_STATE: + default: + result = TRUE; + break; + } + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testSignalNewGenPermeateSubMode function requests transition to + * a new Gen Permeate sub mode. + * @details \b Inputs: none + * @details \b Outputs: none + * @param newSubMode the enumerated sub state of the mode. + * @return none + *************************************************************************/ +void testSignalNewGenPermeateSubMode( U32 newSubMode ) +{ + if ( newSubMode < NUM_OF_FP_GENP_MODE_STATES ) + { + genPermeateState = (FP_GENP_MODE_STATE_T)newSubMode; + // handle the prerequisite if any + switch ( newSubMode ) + { + // Any of these state require no special handling + case FP_GENP_TANK_FILL_STATE: + case FP_GENP_TANK_FULL_STATE: + default: + break; + } + setModeGenPTransition( genPermeateState ); + } +} + /**@}*/