From ea1ac11fbefede9b55714e8c1b9f93ac9714afec Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Sun, 20 Apr 2008 16:05:33 +0200 Subject: * digital/io/src - move private functions directly into source files ; - correct headers. --- digital/io/src/getsamples.c | 25 ------------------------- digital/io/src/getsamples.h | 11 ++--------- digital/io/src/getsamples_cb.c | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 34 deletions(-) (limited to 'digital/io/src') diff --git a/digital/io/src/getsamples.c b/digital/io/src/getsamples.c index 03ce8982..17dee9e8 100644 --- a/digital/io/src/getsamples.c +++ b/digital/io/src/getsamples.c @@ -22,12 +22,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * }}} */ -#include "common.h" #include "getsamples.h" #include "fsm.h" -#include "trap.h" - -#include "io.h" /** * The approach angle to face the distributor. @@ -51,24 +47,3 @@ getsamples_start (int16_t approach_angle, uint8_t sample_bitfield) fsm_init (&getsamples_fsm); fsm_handle_event (&getsamples_fsm, GETSAMPLES_EVENT_start); } - -/* Configure the classifier (using the trap and the internal bit field) for the first bit set to 1. */ -void -getsamples_configure_classifier (void) -{ - uint8_t trap_num; - /* Go through all the bits of the sample bit field */ - for (trap_num = 0; trap_num < trap_count; trap_num++) - { - /* Is the bit set? */ - if (bit_is_set (sample_bitfield_, trap_num)) - { - /* Configure the classifier */ - trap_setup_path_to_box (trap_num); - /* Reset this bit */ - sample_bitfield_ &= ~_BV (trap_num); - /* Stop here */ - return; - } - } -} diff --git a/digital/io/src/getsamples.h b/digital/io/src/getsamples.h index bf127d29..e24056e2 100644 --- a/digital/io/src/getsamples.h +++ b/digital/io/src/getsamples.h @@ -25,6 +25,8 @@ * * }}} */ +#include "common.h" + /** * Start the get samples FSM. * @param approach_angle the angle of approach to face the distributor @@ -37,13 +39,4 @@ void getsamples_start (int16_t approach_angle, uint8_t sample_bitfield); -/** - * Configure the classifier (using the trap and the internal bit field) for - * the first bit set to 1. - * After the configuring the classifier, the bit will be reset to 0 to use the - * next one when calling this function again. - */ -void -getsamples_configure_classifier (void); - #endif /* getsamples_h */ diff --git a/digital/io/src/getsamples_cb.c b/digital/io/src/getsamples_cb.c index e60bf2f8..22fdc959 100644 --- a/digital/io/src/getsamples_cb.c +++ b/digital/io/src/getsamples_cb.c @@ -33,6 +33,8 @@ #include "giboulee.h" /* BOT_ */ #include "playground.h" /* PG_* */ +#include "io.h" + /** * The approach angle to face the distributor. */ @@ -43,6 +45,36 @@ extern int16_t approach_angle_; */ extern uint8_t sample_bitfield_; +/** + * Configure the classifier (using the trap and the internal bit field) for + * the first bit set to 1. + * After the configuring the classifier, the bit will be reset to 0 to use the + * next one when calling this function again. + */ +void +getsamples_configure_classifier (void); + +/* Configure the classifier (using the trap and the internal bit field) for the first bit set to 1. */ +void +getsamples_configure_classifier (void) +{ + uint8_t trap_num; + /* Go through all the bits of the sample bit field */ + for (trap_num = 0; trap_num < trap_count; trap_num++) + { + /* Is the bit set? */ + if (bit_is_set (sample_bitfield_, trap_num)) + { + /* Configure the classifier */ + trap_setup_path_to_box (trap_num); + /* Reset this bit */ + sample_bitfield_ &= ~_BV (trap_num); + /* Stop here */ + return; + } + } +} + /* * FACE_DISTRIBUTOR =bot_move_succeed=> * => OPEN_INPUT_HOLE -- cgit v1.2.3