Index: firmware/App/Modes/ModeGenDialysate.c =================================================================== diff -u -rb2e7c9194acd84783d2bbad64c5720410493e199 -r5db64c182f58f16d6b4b9a5131a2913b4a156ccc --- firmware/App/Modes/ModeGenDialysate.c (.../ModeGenDialysate.c) (revision b2e7c9194acd84783d2bbad64c5720410493e199) +++ firmware/App/Modes/ModeGenDialysate.c (.../ModeGenDialysate.c) (revision 5db64c182f58f16d6b4b9a5131a2913b4a156ccc) @@ -1300,4 +1300,71 @@ return result; } +/*********************************************************************//** + * @brief + * The testValidateDDGenDialysateChangeReq 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 testValidateDDGenDialysateChangeReq( U32 newSubMode ) +{ + BOOL result = FALSE; + + if ( newSubMode < NUM_OF_DD_GEND_MODE_STATES ) + { + switch ( newSubMode ) + { + // TODO add validate condition after checking with Vinay + case DD_GEND_STATE_START: + case DD_GEND_DIALYSATE_BYPASS_STATE: + case DD_GEND_DIALYSATE_DELIVERY_STATE: + case DD_GEND_ISOLATED_UF_STATE: + case DD_GEND_SPENT_CHAMBER_FILL_STATE: + case DD_GEND_BICARB_CHAMBER_FILL_STATE: + case DD_GEND_DIALYSATE_DELIVERY_PAUSE: + default: + result = TRUE; + break; + } + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testSignalNewDDGenDialysateSubMode function request transition + * to a new operation sub mode. + * @details \b Inputs: none + * @details \b Outputs: none + * @param newSubMode the enumerated sub state of the mode + * @return none + *************************************************************************/ +void testSignalNewDDGenDialysateSubMode( U32 newSubMode ) +{ + if ( newSubMode < NUM_OF_DD_GEND_MODE_STATES ) + { + genDialysateState = (DD_GEND_MODE_STATE_T)newSubMode; + + switch ( newSubMode ) + { + // TODO add logic after checking with Vinay + // Any of these state require no special handling + case DD_GEND_STATE_START: + case DD_GEND_DIALYSATE_BYPASS_STATE: + case DD_GEND_DIALYSATE_DELIVERY_STATE: + case DD_GEND_ISOLATED_UF_STATE: + case DD_GEND_SPENT_CHAMBER_FILL_STATE: + case DD_GEND_BICARB_CHAMBER_FILL_STATE: + case DD_GEND_DIALYSATE_DELIVERY_PAUSE: + default: + break; + } + setModeGenDStateTransition( genDialysateState ); + } +} + /**@}*/