Hai All,
I am Implementing finate state machine and approach is as follows:
enum FSM_GATE_STATES { GateOpen=0, GateClose ... ... }; struct FSM_Gate { enum FSM_GATE_STATES ActiveState; }; struct FSM_Gate m_FSM_Gate; void main() { m_FSM_Gate.ActiveState=Gopen; switch(m_FSM_Gate.ActiveState) { Case GateOpen: if(gateOpen_Gateclose()) { m_FSM_Gate.ActiveState=GateClose; } else { //generate out put } break; Case GateClose: //similar implementation break; ... .. } } bit gateOpen_Gateclose() { if(inputTable[1]&&inputTable[2]....n)/*inputs from the field*/ { return 1; } else { return 0; } }
This my approach of FSM... Since the FSM is as single program..I am having 19 states and 38 transition conditions...It is very hard to maintain it as configurable...
Is there any other efficient approach... I need to place the transition conditions in EEPROM give me suggestions... In this program transition condition is like function that is bit gateOpen_gateClose { if(inputTable[]....) { return 1; } else { return 0; } }
I want to make transition as configurable data..... can this function changed in to boolean expresssions???? and stored in EEPROM..Or How to place a function in external EEPROM any linking should be done???..Kindly give me suggestion....