1
2
3
4
5
6
7
8
9
10
11
12
| #include "dui_fsm.h"
|
| void dui_fsm_handle(dui_fsm_t *self, int event, void *args) {
| int i;
| for (i = 0; i < self->t_size; i++) {
| if (event == self->t[i].event && self->cur_state == self->t[i].cur_state) {
| self->t[i].action(args);
| self->cur_state = self->t[i].next_state;
| break;
| }
| }
| }
|
|