Can anyone help me with a C program to design a simple state machine by using macros?
Requirement
S1,S2,S3,S4 are the states and E1, E2,E3,E4,E5,E6,E7,E8 are events ...
when states moving from one state to another respective event should trigger
s1 to s2 ------> E1
s2 to s3 ------> E2
s3 to s4 ------> E3
s4 to s1 ------> E4
s1 to s4 ------> E5
s4 to s3 ------> E6
s3 to s2 ------> E7
s2 to s1 ------> E8
Please share the C program