summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas Schodet2011-05-02 18:52:14 +0200
committerNicolas Schodet2011-05-02 23:00:49 +0200
commit8a6cac0a41be34d36122ab5271295b0ee83fddac (patch)
treeca779a03b2264f6777b8a10dc01aa84698496c29
parent4909f63bea2598489a5895f9bbe1e2622093caa1 (diff)
digital/{ai,io}: move TWI master files to ai directory
-rw-r--r--digital/ai/src/twi_master/asserv.c (renamed from digital/io/src/asserv.c)27
-rw-r--r--digital/ai/src/twi_master/asserv.h (renamed from digital/io/src/asserv.h)15
-rw-r--r--digital/ai/src/twi_master/mimot.c (renamed from digital/io/src/mimot.c)2
-rw-r--r--digital/ai/src/twi_master/mimot.h (renamed from digital/io/src/mimot.h)2
-rw-r--r--digital/ai/src/twi_master/twi_master.c (renamed from digital/io/src/twi_master.c)2
-rw-r--r--digital/ai/src/twi_master/twi_master.h (renamed from digital/io/src/twi_master.h)2
-rw-r--r--digital/io/src/Makefile5
7 files changed, 25 insertions, 30 deletions
diff --git a/digital/io/src/asserv.c b/digital/ai/src/twi_master/asserv.c
index e9adcbbc..d066737b 100644
--- a/digital/io/src/asserv.c
+++ b/digital/ai/src/twi_master/asserv.c
@@ -1,5 +1,5 @@
/* asserv.c */
-/* io - Input & Output with Artificial Intelligence (ai) support on AVR. {{{
+/* ai - Robot Artificial Intelligence. {{{
*
* Copyright (C) 2008 Dufour Jérémy
*
@@ -27,18 +27,12 @@
#include "twi_master.h"
-#include "modules/utils/byte.h" /* v*_to_v* */
+#include "modules/utils/byte.h"
#include "modules/math/fixed/fixed.h"
#include "bot.h"
#include "io.h"
/**
- * @defgroup AsservPrivate Asserv module private variables and functions
- * declarations and definitions
- * @{
- */
-
-/**
* Flag bit position value for the status byte of the asserv.
*/
enum asserv_status_flag_e
@@ -106,6 +100,16 @@ typedef struct asserv_struct_s
*/
asserv_struct_s asserv_status;
+/** Set scale.
+ * @param scale number of millimeter per step (f8.24).
+ */
+static void
+asserv_set_scale (uint32_t scale)
+{
+ asserv_scale = scale;
+ asserv_scale_inv = fixed_div_f824 (1L << 24, scale);
+}
+
void
asserv_init (void)
{
@@ -408,13 +412,6 @@ asserv_goto (uint32_t x, uint32_t y, uint8_t backward)
}
void
-asserv_set_scale (uint32_t scale)
-{
- asserv_scale = scale;
- asserv_scale_inv = fixed_div_f824 (1L << 24, scale);
-}
-
-void
asserv_motor0_zero_position (int8_t speed)
{
uint8_t *buffer = twi_master_get_buffer (ASSERV_SLAVE);
diff --git a/digital/io/src/asserv.h b/digital/ai/src/twi_master/asserv.h
index a92d95f7..0d29ba96 100644
--- a/digital/io/src/asserv.h
+++ b/digital/ai/src/twi_master/asserv.h
@@ -1,7 +1,7 @@
#ifndef asserv_h
#define asserv_h
/* asserv.h */
-/* io - Input & Output with Artificial Intelligence (ai) support on AVR. {{{
+/* ai - Robot Artificial Intelligence. {{{
*
* Copyright (C) 2008 Dufour Jérémy
*
@@ -27,10 +27,9 @@
#include "defs.h"
/**
- * @file Control the asserv board from io using the TWI protocol.
+ * @file Control the asserv board using the TWI protocol.
* This files contains the 'public' functions to send commands to the asserv
* board using a protocol over TWI communication.
- * @see trunk/digital/io/doc/proto_asserv.txt
*/
/** Slave number in twi_master list. */
@@ -67,7 +66,7 @@ typedef enum asserv_status_e
none,
/** The command has succeed. */
success,
- /** The command has failed. The bot or the motor0 is blocked */
+ /** The command has failed. The bot or the motor is blocked */
failure
} asserv_status_e;
@@ -176,7 +175,7 @@ asserv_move_angularly (int16_t angle);
/**
* Make the bot turn of an absolute angle.
* The angle is absolute and not a difference with the current one.
- * @param a the absolute angle in degrees
+ * @param a the absolute angle
*/
void
asserv_goto_angle (int16_t angle);
@@ -279,12 +278,6 @@ asserv_set_position (int32_t x, int32_t y, int16_t angle);
void
asserv_goto (uint32_t x, uint32_t y, uint8_t backward);
-/** Set scale.
- * @param scale number of millimeter per step (f8.24).
- */
-void
-asserv_set_scale (uint32_t scale);
-
/** Reset the motor0 to the zero position. */
void
asserv_motor0_zero_position (int8_t speed);
diff --git a/digital/io/src/mimot.c b/digital/ai/src/twi_master/mimot.c
index ba09a3f5..af6ff5f9 100644
--- a/digital/io/src/mimot.c
+++ b/digital/ai/src/twi_master/mimot.c
@@ -1,5 +1,5 @@
/* mimot.c */
-/* io - Input & Output with Artificial Intelligence (ai) support on AVR. {{{
+/* ai - Robot Artificial Intelligence. {{{
*
* Copyright (C) 2010 Nicolas Schodet
*
diff --git a/digital/io/src/mimot.h b/digital/ai/src/twi_master/mimot.h
index 98709162..60811c10 100644
--- a/digital/io/src/mimot.h
+++ b/digital/ai/src/twi_master/mimot.h
@@ -1,7 +1,7 @@
#ifndef mimot_h
#define mimot_h
/* mimot.h */
-/* io - Input & Output with Artificial Intelligence (ai) support on AVR. {{{
+/* ai - Robot Artificial Intelligence. {{{
*
* Copyright (C) 2010 Nicolas Schodet
*
diff --git a/digital/io/src/twi_master.c b/digital/ai/src/twi_master/twi_master.c
index cb600da8..90977fd3 100644
--- a/digital/io/src/twi_master.c
+++ b/digital/ai/src/twi_master/twi_master.c
@@ -1,5 +1,5 @@
/* twi_master.c */
-/* io - Input & Output with Artificial Intelligence (ai) support on AVR. {{{
+/* ai - Robot Artificial Intelligence. {{{
*
* Copyright (C) 2010 Nicolas Schodet
*
diff --git a/digital/io/src/twi_master.h b/digital/ai/src/twi_master/twi_master.h
index e7cb9d86..e75dbfab 100644
--- a/digital/io/src/twi_master.h
+++ b/digital/ai/src/twi_master/twi_master.h
@@ -1,7 +1,7 @@
#ifndef twi_master_h
#define twi_master_h
/* twi_master.h */
-/* io - Input & Output with Artificial Intelligence (ai) support on AVR. {{{
+/* ai - Robot Artificial Intelligence. {{{
*
* Copyright (C) 2010 Nicolas Schodet
*
diff --git a/digital/io/src/Makefile b/digital/io/src/Makefile
index 5dfea34b..ceb7c206 100644
--- a/digital/io/src/Makefile
+++ b/digital/io/src/Makefile
@@ -11,6 +11,7 @@ io_SOURCES = main.c servo.avr.c eeprom.avr.c pwm.c \
# Modules needed for IO.
MODULES = proto uart twi utils adc math/fixed math/geometry path/astar \
trace flash spi
+AI_MODULES = twi_master
# Configuration file.
CONFIGFILE = avrconfig.h
# IO board use an ATMega128.
@@ -19,6 +20,10 @@ AVR_MCU = atmega128
OPTIMIZE = -O2
HOST_LIBS = -lm
+vpath %.c $(AI_MODULES:%=../../ai/src/%)
+vpath %.h $(AI_MODULES:%=../../ai/src/%)
+INCLUDES += -I. $(AI_MODULES:%=-I../../ai/src/%)
+
# FSM.
FSM = ai
FSM_SOURCES := top init move loader hola