summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérémy Dufour2009-05-18 17:46:31 +0200
committerJérémy Dufour2009-05-18 17:46:31 +0200
commit664861716254b9bad07f9c0c5a917834361e2aeb (patch)
treea3a936b240421a557922e01f1237b6fcc305ebd8
parentaefcd66e61bebdc9f10929adadd6b13dc10a2da1 (diff)
* digital/io/src:
- get the color of the bot earlier.
-rw-r--r--digital/io/src/init.fsm2
-rw-r--r--digital/io/src/init_cb.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/digital/io/src/init.fsm b/digital/io/src/init.fsm
index c1700e50..72db9a6f 100644
--- a/digital/io/src/init.fsm
+++ b/digital/io/src/init.fsm
@@ -67,6 +67,7 @@ WAIT_FIRST_JACK_IN:
WAIT_FIRST_JACK_OUT:
jack_removed_from_bot -> WAIT_SECOND_JACK_IN
start trace module.
+ get and store the color of the bot.
WAIT_SECOND_JACK_IN:
jack_inserted_into_bot -> WAIT_FOR_HANDS_OUT
@@ -90,7 +91,6 @@ SET_ANGULAR_POSITION:
GO_AWAY_FROM_THE_WALL:
bot_move_succeed -> FACE_OTHER_WALL
- get and store the color of the bot.
turn to face the other wall.
FACE_OTHER_WALL:
diff --git a/digital/io/src/init_cb.c b/digital/io/src/init_cb.c
index 54fff5ac..f763aaed 100644
--- a/digital/io/src/init_cb.c
+++ b/digital/io/src/init_cb.c
@@ -59,12 +59,15 @@ init__WAIT_FIRST_JACK_IN__jack_inserted_into_bot (void)
* WAIT_FIRST_JACK_OUT =jack_removed_from_bot=>
* => WAIT_SECOND_JACK_IN
* start trace module.
+ * get and store the color of the bot.
*/
fsm_branch_t
init__WAIT_FIRST_JACK_OUT__jack_removed_from_bot (void)
{
/* Initialize trace module (erase the flash). */
trace_init ();
+ /* Get the color. */
+ bot_color = switch_get_color ();
return init_next (WAIT_FIRST_JACK_OUT, jack_removed_from_bot);
}
@@ -140,8 +143,6 @@ init__SET_ANGULAR_POSITION__asserv_last_cmd_ack (void)
fsm_branch_t
init__GO_AWAY_FROM_THE_WALL__bot_move_succeed (void)
{
- /* Get the color. */
- bot_color = switch_get_color ();
/* Face the other wall. */
asserv_goto_angle (PG_A_VALUE_COMPUTING (180 * BOT_ANGLE_DEGREE));
return init_next (GO_AWAY_FROM_THE_WALL, bot_move_succeed);