From f5a472887d2514647ca5cd0dd8ead0790e480094 Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Mon, 18 May 2009 13:03:58 +0200 Subject: * 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. --- digital/io/src/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'digital/io/src/main.c') 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); -- cgit v1.2.3