summaryrefslogtreecommitdiffhomepage
path: root/digital/io/src/main.c
diff options
context:
space:
mode:
authorJérémy Dufour2009-05-18 13:03:58 +0200
committerJérémy Dufour2009-05-18 13:03:58 +0200
commitf5a472887d2514647ca5cd0dd8ead0790e480094 (patch)
tree697ba9b688554ccfbf095afed40a5c84bf68daa5 /digital/io/src/main.c
parent8e6335ad1ff9df290693d5f4bbf919c205d846cc (diff)
* digital/io/src:
- rewrite init FSM: - set X, Y, A position when doing the fuck the wall movement (thanks to Fred for the idea and Ni for debugging), - for safety reason, the procedure requires to insert the jack, remove it, insert it again. The bot will wait 2 seconds and set himself to the start position. Then you can remove the jack to make the match begin. - update name of the define for the length of the table.
Diffstat (limited to 'digital/io/src/main.c')
-rw-r--r--digital/io/src/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/digital/io/src/main.c b/digital/io/src/main.c
index 6bd2d14b..1384be2f 100644
--- a/digital/io/src/main.c
+++ b/digital/io/src/main.c
@@ -164,7 +164,7 @@ main_event_to_fsm (void)
FSM_HANDLE_EVENT (&move_fsm,
MOVE_EVENT_bot_move_succeed);
FSM_HANDLE_EVENT (&init_fsm,
- INIT_EVENT_move_done);
+ INIT_EVENT_bot_move_succeed);
}
else if (move_status == failure)
{
@@ -216,6 +216,8 @@ main_event_to_fsm (void)
{
FSM_HANDLE_EVENT (&top_fsm,
TOP_EVENT_jack_removed_from_bot);
+ FSM_HANDLE_EVENT (&init_fsm,
+ INIT_EVENT_jack_removed_from_bot);
}
else
{
@@ -309,7 +311,7 @@ main_init (void)
switch_init ();
/* Path module */
path_init (PG_BORDER_DISTANCE, PG_BORDER_DISTANCE,
- PG_WIDTH - PG_BORDER_DISTANCE, PG_HEIGHT - PG_BORDER_DISTANCE);
+ PG_WIDTH - PG_BORDER_DISTANCE, PG_LENGTH - PG_BORDER_DISTANCE);
/* Init all FSM (except move FSM) */
fsm_init(&top_fsm);
fsm_init(&init_fsm);