From d3c8bf5e81f46d66ff0badcbcbf20a3d828a30eb Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Mon, 14 Apr 2008 12:06:01 +0200 Subject: * digital/io/src * build - add dependency of fsm.h for main.c (for bootstrap) ; - ensure it is building for host target. * get samples FSM - remove unneeded fields in the getsamples structures ; - rename it to be more 'private' (to prevent declaring the same one) ; * top FSM - rewrite it ; - still missing some parts to implement. * general - manage color of the bot ; - initialize the switch module in the main_init ; - add position of the gutter. --- digital/io/src/getsamples_cb.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'digital/io/src/getsamples_cb.c') diff --git a/digital/io/src/getsamples_cb.c b/digital/io/src/getsamples_cb.c index 85dca001..8f7abefb 100644 --- a/digital/io/src/getsamples_cb.c +++ b/digital/io/src/getsamples_cb.c @@ -33,6 +33,11 @@ #include "giboulee.h" /* BOT_ */ #include "playground.h" /* PG_* */ +/** + * Get samples shared data. + */ +extern struct getsamples_data_t getsamples_data_; + /* * FACE_DISTRIBUTOR =bot_move_succeed=> * => OPEN_INPUT_HOLE @@ -68,7 +73,7 @@ fsm_branch_t getsamples__CLOSE_INPUT_HOLE__arm_move_succeed (void) { /* Tell the top FSM we have finished */ - fsm_handle_event (&top_fsm, getsamples_data.event); + fsm_handle_event (&top_fsm, TOP_EVENT_get_samples_fsm_finished); return getsamples_next (CLOSE_INPUT_HOLE, arm_move_succeed); } @@ -84,7 +89,7 @@ fsm_branch_t getsamples__TAKE_SAMPLES__arm_pass_noted_position (void) { /* More samples? */ - if (getsamples_data.sample_bitfield) + if (getsamples_data_.sample_bitfield) { /* Compute notifier */ uint16_t arm_current_position = asserv_get_arm_position (); @@ -115,7 +120,7 @@ fsm_branch_t getsamples__IDLE__start (void) { /* Face the distributor */ - asserv_goto_angle (getsamples_data.distributor_angle); + asserv_goto_angle (getsamples_data_.approach_angle); return getsamples_next (IDLE, start); } -- cgit v1.2.3