summaryrefslogtreecommitdiffhomepage
path: root/digital/io/src/fsm_templates/template_fsm.c
blob: 03ce5abfa07db4c7fbbc533af26f61f9f0822905 (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
50
51
52
53
54
55
/*
 * THIS IS AN AUTOMATICALLY GENERATED FILE, DO NOT EDIT!
 *
 * %(name)s
 *
%(*comments)s */
#include "common.h"
#include "fsm.h"
#include "%(prefix)s_cb.h"

#define NULL ((void *)0L)

/* %(name)s transition table. */
static const fsm_transition_t PROGMEM
%(prefix)s_transition_table[%(PREFIX)s_STATE_NB][%(PREFIX)s_EVENT_NB] = {
%(transition_table)s};

/* %(name)s state timeout table. */
static const uint16_t
%(prefix)s_state_timeout_table[%(PREFIX)s_STATE_NB] = {
%(states,%(@timeout|0xffff)s)s};

#ifdef HOST

/* %(name)s state names. */
static const char *
%(prefix)s_states_names[] = {
%(states_names)s};

/* %(name)s event names. */
static const char *
%(prefix)s_events_names[] = {
%(events_names)s};

#endif /* HOST */

/* %(name)s context. */
fsm_t %(prefix)s_fsm = {
    &%(prefix)s_transition_table[0][0],
    %(PREFIX)s_EVENT_NB,
    {
    %(initials)s},
    {
    %(initials)s},
    %(initials_nb)s,
    &%(prefix)s_state_timeout_table[0],
    { 0 },
    %(PREFIX)s_EVENT_state_timeout,
#ifdef HOST
    "%(name)s",
    %(prefix)s_states_names,
    %(prefix)s_events_names,
#endif
};