From f416af1eeed92e9508744544e39983af82479965 Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Mon, 18 May 2009 22:29:25 +0200 Subject: * digital/io/src: - fix event sent to the wrong FSM, - start top FSM, - rewrite event generated by move FSM when its finished, - init FSM generates an event when the match start, - init FSM starts the chrono when the match start, - top FSM now uses the event generated by the init FSM to know when the match start and not the jack states. --- digital/io/src/init_cb.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'digital/io/src/init_cb.c') diff --git a/digital/io/src/init_cb.c b/digital/io/src/init_cb.c index f763aaed..063314a3 100644 --- a/digital/io/src/init_cb.c +++ b/digital/io/src/init_cb.c @@ -31,6 +31,7 @@ #include "main.h" #include "aquajim.h" #include "switch.h" +#include "chrono.h" #include "modules/trace/trace.h" /* @@ -216,7 +217,7 @@ init__GO_AWAY_FROM_THE_WALL_AGAIN__bot_move_succeed (void) /* * GO_TO_START_POSITION =bot_move_succeed=> - * => IDLE + * => WAIT_SECOND_JACK_OUT * nothing to do, the bot is at the start position. */ fsm_branch_t @@ -225,4 +226,19 @@ init__GO_TO_START_POSITION__bot_move_succeed (void) return init_next (GO_TO_START_POSITION, bot_move_succeed); } +/* + * WAIT_SECOND_JACK_OUT =jack_removed_from_bot=> + * => IDLE + * tell other FSM the match begins. + */ +fsm_branch_t +init__WAIT_SECOND_JACK_OUT__jack_removed_from_bot (void) +{ + /* Set the flag to transmit to other FSM. */ + init_match_is_started = 1; + /* Start the chrono. */ + chrono_init (); + return init_next (WAIT_SECOND_JACK_OUT, jack_removed_from_bot); +} + -- cgit v1.2.3