blob: 713c329e9a0bdd4100a06e68d541ea8f3c878a8a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
enum
{
EVENT_ONE_SECOND,
}MACHINE_FLICKER_EVENT;
enum
{
MACHINE_FLICKER,
}MACHINES;
extern void machine_flicker_light_off(enum MACHINE_FLICKER_EVENT event);
extern void machine_flicker_light_on(enum MACHINE_FLICKER_EVENT event);
extern machine_buffer_t* turn_on_light(machine_buffer_t *arguments,machine_buffer_t *input);
extern machine_buffer_t* turn_off_light(machine_buffer_t *arguments,machine_buffer_t *input);
void machine_flicker_push_event(enum MACHINE_FLICKER_EVENT event);
void (*machine_states[])()={machine_flicker_light_on};
void machine_flicker_push_event(enum MACHINE_FLICKER_EVENT event)
{
machine_states[MACHINE_FLICKER](event);
}
void machine_flicker_light_off(enum MACHINE_FLICKER_EVENT event)
{
switch(event)
{
case EVENT_ONE_SECOND:
turn_on_light(get_machine_buffer(""));
machine_states[MACHINE_FLICKER]=machine_flicker_light_on;
break;
}
}
void machine_flicker_light_on(enum MACHINE_FLICKER_EVENT event)
{
switch(event)
{
case EVENT_ONE_SECOND:
turn_off_light(get_machine_buffer(""));
machine_states[MACHINE_FLICKER]=machine_flicker_light_off;
break;
}
}
|