summaryrefslogtreecommitdiffhomepage
path: root/digital/io/src/main.h
blob: 06f2a66909bde59d2db97ca7dd334f46ab0f083c (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef main_h
#define main_h
/* main.h */
/* io - Input & Output with Artificial Intelligence (ai) support on AVR. {{{
 *
 * Copyright (C) 2008 Dufour Jérémy
 *
 * APBTeam:
 *        Web: http://apbteam.org/
 *      Email: team AT apbteam DOT org
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 * }}} */

/**
 * Post a event to the top FSM in the next iteration of main loop.
 * You just need to set variable to the value of the event you want to post to
 * the top FSM and add one to it (because some event could have a zero value).
 * It will be posted and cleared in the next main loop iteration.
 */
extern uint8_t main_post_event_for_top_fsm;

/**
 * Do not generate sharps event for FSM during a certain count of cycles.
 * This flag is used by the move FSM to prevent it from being alerted by the
 * main loop that there is an object in from of the bot.
 */
extern uint16_t main_sharp_ignore_event;

/**
 * Post an event for the main loop to wake up the move FSM in a certain count
 * of cycles.
 * This flag is used by the move FSM to wait a certain amount of time before
 * checking on the sharps again.
 */
extern uint16_t main_move_wait_cycle;

/**
 * Post an event for the main loop to wake up the getsamples FSM in a certain
 * count of cycles.
 * This is used by the getsamples FSM to timeout if the arm is completely
 * blocked.
 */
extern uint16_t main_getsamples_wait_cycle;

/**
 * Post an event for the init loop to wait a certain amount of time before
 * make any move
 */
extern uint16_t main_init_wait_cycle;

/**
 * Flag for homologation, to disable the path finding and always stop in front
 * of an obstacle and wait.
 */
extern uint8_t main_always_stop_for_obstacle;

#endif /* main_h */