From 187903a80f8763387578fe6b11e0abb851f6f101 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Fri, 6 Apr 2012 23:21:58 +0200 Subject: digital/ai/src/twi_master: support asserv without aux --- digital/ai/src/twi_master/asserv.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'digital/ai/src/twi_master/asserv.h') diff --git a/digital/ai/src/twi_master/asserv.h b/digital/ai/src/twi_master/asserv.h index c9a52a11..90e3b785 100644 --- a/digital/ai/src/twi_master/asserv.h +++ b/digital/ai/src/twi_master/asserv.h @@ -39,7 +39,7 @@ #define ASSERV_TWI_ADDRESS 4 /** Length of the status buffer (not including CRC). */ -#define ASSERV_STATUS_LENGTH 15 +#define ASSERV_STATUS_LENGTH (11 + AC_ASSERV_AUX_NB * 2) /** Use backward movements. */ #define ASSERV_BACKWARD 1 @@ -79,6 +79,8 @@ typedef enum asserv_status_e asserv_status_e asserv_move_cmd_status (void); +#if AC_ASSERV_AUX_NB + /** * Is last motor0 class command has successfully ended? * This function is used to know the status of the last motor0 command. It @@ -97,6 +99,8 @@ asserv_motor0_cmd_status (void); asserv_status_e asserv_motor1_cmd_status (void); +#endif /* AC_ASSERV_AUX_NB */ + /** * Get the current position of the bot. * @param current_position the current position to update. @@ -104,6 +108,8 @@ asserv_motor1_cmd_status (void); void asserv_get_position (position_t *current_position); +#if AC_ASSERV_AUX_NB + /** * Get the motor0 position. * @return the position of the motor0 (in steps). @@ -118,6 +124,8 @@ asserv_get_motor0_position (void); uint16_t asserv_get_motor1_position (void); +#endif /* AC_ASSERV_AUX_NB */ + /** * Are we moving forward/backward? * @return @@ -204,6 +212,8 @@ void asserv_push_the_wall (uint8_t backward, uint32_t init_x, uint32_t init_y, uint16_t init_a); +#if AC_ASSERV_AUX_NB + /** * Move the motor0. * Motor0 class command. @@ -226,6 +236,8 @@ asserv_move_motor0_absolute (uint16_t position, uint8_t speed); void asserv_move_motor1_absolute (uint16_t position, uint8_t speed); +#endif /* AC_ASSERV_AUX_NB */ + /** * Set current X position. * Other class command. @@ -284,6 +296,8 @@ asserv_set_position (int32_t x, int32_t y, int16_t angle); void asserv_goto (uint32_t x, uint32_t y, uint8_t backward); +#if AC_ASSERV_AUX_NB + /** Reset the motor0 to the zero position. */ void asserv_motor0_zero_position (int8_t speed); @@ -300,4 +314,6 @@ asserv_motor0_free (void); void asserv_motor1_free (void); +#endif /* AC_ASSERV_AUX_NB */ + #endif /* asserv_h */ -- cgit v1.2.3