Lines Matching refs:pFsm
92 fsm_stateMachine_t **pFsm, in fsm_Create() argument
97 if ((pFsm == NULL) || (MaxNoOfStates == 0) || (MaxNoOfEvents == 0)) in fsm_Create()
103 *pFsm = (fsm_stateMachine_t *)os_memoryAlloc(hOs, sizeof(fsm_stateMachine_t)); in fsm_Create()
104 if (*pFsm == NULL) in fsm_Create()
108 os_memoryZero(hOs, (*pFsm), sizeof(fsm_stateMachine_t)); in fsm_Create()
111 …(*pFsm)->stateEventMatrix = (fsm_Matrix_t)os_memoryAlloc(hOs, MaxNoOfStates * MaxNoOfEvents * size… in fsm_Create()
112 if ((*pFsm)->stateEventMatrix == NULL) in fsm_Create()
114 os_memoryFree(hOs, *pFsm, sizeof(fsm_stateMachine_t)); in fsm_Create()
117 os_memoryZero(hOs, (*pFsm)->stateEventMatrix, in fsm_Create()
120 (*pFsm)->MaxNoOfStates = MaxNoOfStates; in fsm_Create()
121 (*pFsm)->MaxNoOfEvents = MaxNoOfEvents; in fsm_Create()
149 fsm_stateMachine_t *pFsm) in fsm_Unload() argument
152 if (pFsm == NULL) in fsm_Unload()
158 if (pFsm->stateEventMatrix != NULL) in fsm_Unload()
160 os_memoryFree(hOs, pFsm->stateEventMatrix, in fsm_Unload()
161 pFsm->MaxNoOfStates * pFsm->MaxNoOfEvents * sizeof(fsm_actionCell_t)); in fsm_Unload()
165 os_memoryFree(hOs, pFsm, sizeof(fsm_stateMachine_t)); in fsm_Unload()
193 TI_STATUS fsm_Config(fsm_stateMachine_t *pFsm, in fsm_Config() argument
201 if ((pFsm == NULL) || in fsm_Config()
207 if ((ActiveNoOfStates > pFsm->MaxNoOfStates) || in fsm_Config()
208 (ActiveNoOfEvents > pFsm->MaxNoOfEvents)) in fsm_Config()
214 os_memoryCopy(hOs, (void *)pFsm->stateEventMatrix, (void *)pMatrix, in fsm_Config()
218 pFsm->ActiveNoOfStates = ActiveNoOfStates; in fsm_Config()
219 pFsm->ActiveNoOfEvents = ActiveNoOfEvents; in fsm_Config()
220 pFsm->transitionFunc = transFunc; in fsm_Config()
245 TI_STATUS fsm_Event(fsm_stateMachine_t *pFsm, in fsm_Event() argument
254 if (pFsm == NULL) in fsm_Event()
260 if ((*currentState >= pFsm->ActiveNoOfStates) || (event >= pFsm->ActiveNoOfEvents)) in fsm_Event()
267 *currentState = pFsm->stateEventMatrix[(*currentState * pFsm->ActiveNoOfEvents) + event].nextState; in fsm_Event()
270 if ((*pFsm->stateEventMatrix[(oldState * pFsm->ActiveNoOfEvents) + event].actionFunc) == NULL) in fsm_Event()
274 status = (*pFsm->stateEventMatrix[(oldState * pFsm->ActiveNoOfEvents) + event].actionFunc)(pData); in fsm_Event()
301 TI_STATUS fsm_GetNextState(fsm_stateMachine_t *pFsm, in fsm_GetNextState() argument
306 if (pFsm != NULL) in fsm_GetNextState()
308 if ((currentState < pFsm->ActiveNoOfStates) && (event < pFsm->ActiveNoOfEvents)) in fsm_GetNextState()
310 *nextState = pFsm->stateEventMatrix[(currentState * pFsm->ActiveNoOfEvents) + event].nextState; in fsm_GetNextState()