hc
2023-11-20 2e7bd41e4e8ab3d1efdabd9e263a2f7fe79bff8c
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;
        }
    }
}