summaryrefslogtreecommitdiffhomepage
path: root/digital/io/src/top.fsm
blob: 3c3eaa7e1ee6ed775f205806be60b93fb70f87df (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
# Top FSM.
top
  Main FSM calling other FSM.

States:
 IDLE
  waiting for the beginning of the top FSM.
 WAIT_FIRST_JACK_IN
  waiting for the jack to be inserted into the bot for the first time.
 WAIT_FIRST_JACK_OUT
  waiting for the jack to be removed from the bot for the first time.
 WAIT_SECOND_JACK_IN
  waiting for the jack to be inserted into the bot for the second time.
 WAIT_SECOND_JACK_OUT
  waiting for the jack to be removed into the bot for the second time.
 GET_PUCK_FROM_THE_GROUND
  get some pucks from the ground.
 GET_PUCK_FROM_DISTRIBUTOR
  get some pucks from the distributor.


Events:
 start
  initialize the FSM.
 move_fsm_finished
  when the move FSM returns.
 jack_inserted_into_bot
  the jack is inserted into the bot.
 jack_removed_from_bot
  the jack is removed from the bot.
 state_timeout
  timeout in cycle count.
 asserv_last_cmd_ack
  last command sent to the asserv board has been acquitted.

IDLE:
 start -> WAIT_FIRST_JACK_IN
  nothing to do.

WAIT_FIRST_JACK_IN:
 jack_inserted_into_bot -> WAIT_FIRST_JACK_OUT
  nothing to do.

WAIT_FIRST_JACK_OUT:
 jack_removed_from_bot -> WAIT_SECOND_JACK_IN
  nothing to do.

WAIT_SECOND_JACK_IN:
 jack_removed_from_bot -> WAIT_SECOND_JACK_OUT
  nothing to do.

WAIT_SECOND_JACK_OUT:
 jack_removed_from_bot -> GET_PUCK_FROM_THE_GROUND
  the match start, try to get some puck from the ground.