summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFlorent Duchon2012-04-21 16:58:09 +0200
committerFlorent Duchon2012-04-21 18:05:03 +0200
commit86855bce3598f21f1b1c81329f98cdc434edfa7d (patch)
tree03d7045bdbac74c9b1da72ae2e2d9fd058c255e4
parent90527d1cf27582b1e7bb8588afbed8989453f606 (diff)
digital/beacon: use different debug files for simu or avr mode
-rw-r--r--digital/beacon/src/calibration.c2
-rw-r--r--digital/beacon/src/codewheel.c2
-rw-r--r--digital/beacon/src/debug_avr.c (renamed from digital/beacon/src/debug.c)2
-rw-r--r--digital/beacon/src/debug_avr.h70
-rw-r--r--digital/beacon/src/debug_simu.h (renamed from digital/beacon/src/debug.h)44
-rw-r--r--digital/beacon/src/formula.c2
-rw-r--r--digital/beacon/src/laser.c2
-rw-r--r--digital/beacon/src/main_avr.c2
-rw-r--r--digital/beacon/src/network.c2
-rw-r--r--digital/beacon/src/position.c2
-rw-r--r--digital/beacon/src/recovery.c2
-rw-r--r--digital/beacon/src/servo.c2
-rw-r--r--digital/beacon/src/trust.c2
-rw-r--r--digital/beacon/src/update.c2
14 files changed, 85 insertions, 53 deletions
diff --git a/digital/beacon/src/calibration.c b/digital/beacon/src/calibration.c
index 75e33fba..fe661407 100644
--- a/digital/beacon/src/calibration.c
+++ b/digital/beacon/src/calibration.c
@@ -24,7 +24,7 @@
* }}} */
#include <appTimer.h>
-#include "debug.h"
+#include "debug_avr.h"
#include "servo.h"
#include "calibration.h"
diff --git a/digital/beacon/src/codewheel.c b/digital/beacon/src/codewheel.c
index efcd9931..32b45b37 100644
--- a/digital/beacon/src/codewheel.c
+++ b/digital/beacon/src/codewheel.c
@@ -25,7 +25,7 @@
#include <types.h>
#include <avr/interrupt.h>
-#include "debug.h"
+#include "debug_avr.h"
#include "codewheel.h"
diff --git a/digital/beacon/src/debug.c b/digital/beacon/src/debug_avr.c
index fb2cf589..50dcb1f6 100644
--- a/digital/beacon/src/debug.c
+++ b/digital/beacon/src/debug_avr.c
@@ -27,7 +27,7 @@
#include <appTimer.h>
#include "configuration.h"
#include "calibration.h"
-#include "debug.h"
+#include "debug_avr.h"
#include "servo.h"
#include "codewheel.h"
#include "laser.h"
diff --git a/digital/beacon/src/debug_avr.h b/digital/beacon/src/debug_avr.h
new file mode 100644
index 00000000..add62690
--- /dev/null
+++ b/digital/beacon/src/debug_avr.h
@@ -0,0 +1,70 @@
+/* debug.h */
+/* Macro for debug traces. {{{
+ *
+ * Copyright (C) 2011 Florent Duchon
+ *
+ * APBTeam:
+ * Web: http://apbteam.org/
+ * Email: team AT apbteam DOT org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * }}} */
+
+#ifndef _DEBUG_AVR_H
+#define _DEBUG_AVR_H
+
+#include <stdio.h>
+#include "configuration.h"
+
+#define OPEN_USART HAL_OpenUsart
+#define CLOSE_USART HAL_CloseUsart
+#define WRITE_USART HAL_WriteUsart
+#define READ_USART HAL_ReadUsart
+#define USART_CHANNEL APP_USART_CHANNEL
+#define DEBUG_TASK_PERIOD 700L
+#define WHEEL_TASK_PERIOD 1000L
+
+typedef enum
+{
+ FREE,
+ BUSY
+} TUSART_bus_state;
+
+typedef enum
+{
+ EMPTY,
+ FILLED
+} TUSART_buffer_level;
+
+/* This function initializes the USART interface for debugging on avr */
+void initSerialInterface(void);
+
+/* TX USART Callback */
+void usartTXCallback(void);
+
+/* RX USART Callback */
+void usartRXCallback(uint16_t bytesToRead);
+
+/* This function sends data string via the USART interface */
+void uprintf(char *format, ...);
+
+/* This function starts the debug task */
+void debug_start_stop_task(void);
+
+/* Debug task callback */
+void debug_task(void);
+
+#endif
diff --git a/digital/beacon/src/debug.h b/digital/beacon/src/debug_simu.h
index 73beab06..35c7b346 100644
--- a/digital/beacon/src/debug.h
+++ b/digital/beacon/src/debug_simu.h
@@ -22,19 +22,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* }}} */
-#ifndef _DEBUG_H
-#define _DEBUG_H
-#include <stdio.h>
-#include "configuration.h"
+#ifndef _DEBUG_SIMU_H
+#define _DEBUG_SIMU_H
-#define OPEN_USART HAL_OpenUsart
-#define CLOSE_USART HAL_CloseUsart
-#define WRITE_USART HAL_WriteUsart
-#define READ_USART HAL_ReadUsart
-#define USART_CHANNEL APP_USART_CHANNEL
-#define DEBUG_TASK_PERIOD 700L
-#define WHEEL_TASK_PERIOD 1000L
+#include <stdio.h>
// #define DEBUG_POSITION_ENABLE
// #define DEBUG_UPDATE_ENABLE
@@ -80,34 +72,4 @@
#define DEBUG_TRUST(f,s...) ((void)0)
#endif
-typedef enum
-{
- FREE,
- BUSY
-} TUSART_bus_state;
-
-typedef enum
-{
- EMPTY,
- FILLED
-} TUSART_buffer_level;
-
-/* This function initializes the USART interface for debugging on avr */
-void initSerialInterface(void);
-
-/* TX USART Callback */
-void usartTXCallback(void);
-
-/* RX USART Callback */
-void usartRXCallback(uint16_t bytesToRead);
-
-/* This function sends data string via the USART interface */
-void uprintf(char *format, ...);
-
-/* This function starts the debug task */
-void debug_start_stop_task(void);
-
-/* Debug task callback */
-void debug_task(void);
-
#endif
diff --git a/digital/beacon/src/formula.c b/digital/beacon/src/formula.c
index 8391b8f8..03f34dd4 100644
--- a/digital/beacon/src/formula.c
+++ b/digital/beacon/src/formula.c
@@ -24,7 +24,7 @@
* }}} */
#include <math.h>
-#include "debug.h"
+#include "debug_simu.h"
#include "position.h"
#include "formula.h"
diff --git a/digital/beacon/src/laser.c b/digital/beacon/src/laser.c
index 9d9d1fe0..585e5739 100644
--- a/digital/beacon/src/laser.c
+++ b/digital/beacon/src/laser.c
@@ -25,7 +25,7 @@
#include <types.h>
#include <avr/interrupt.h>
-#include "debug.h"
+#include "debug_avr.h"
#include "laser.h"
diff --git a/digital/beacon/src/main_avr.c b/digital/beacon/src/main_avr.c
index 7e38a6f3..0e4b1d3e 100644
--- a/digital/beacon/src/main_avr.c
+++ b/digital/beacon/src/main_avr.c
@@ -31,7 +31,7 @@
#include "network.h"
#include "position.h"
#include "laser.h"
-#include "debug.h"
+#include "debug_avr.h"
#include "servo.h"
#include "led.h"
#include "twi.h"
diff --git a/digital/beacon/src/network.c b/digital/beacon/src/network.c
index 723a6abb..0b8785c1 100644
--- a/digital/beacon/src/network.c
+++ b/digital/beacon/src/network.c
@@ -28,7 +28,7 @@
#include <zdo.h>
#include "configuration.h"
#include "network.h"
-#include "debug.h"
+#include "debug_avr.h"
#include "led.h"
diff --git a/digital/beacon/src/position.c b/digital/beacon/src/position.c
index ca98b7b5..96bfb5e6 100644
--- a/digital/beacon/src/position.c
+++ b/digital/beacon/src/position.c
@@ -24,7 +24,7 @@
* }}} */
#include "position.h"
-#include "debug.h"
+#include "debug_simu.h"
#include "recovery.h"
#include "update.h"
#include "formula.h"
diff --git a/digital/beacon/src/recovery.c b/digital/beacon/src/recovery.c
index a090b32c..891e35ed 100644
--- a/digital/beacon/src/recovery.c
+++ b/digital/beacon/src/recovery.c
@@ -27,7 +27,7 @@
#include "position.h"
#include "recovery.h"
#include "trust.h"
-#include "debug.h"
+#include "debug_simu.h"
/* This function is used to calculate all obstacle positions from sractch */
TRecoveryStatus recovery(coord_s * new_point,opponent_s opp[MAX_OBSTACLE])
diff --git a/digital/beacon/src/servo.c b/digital/beacon/src/servo.c
index 2d590c3d..24e502ce 100644
--- a/digital/beacon/src/servo.c
+++ b/digital/beacon/src/servo.c
@@ -26,7 +26,7 @@
#include <types.h>
#include <irq.h>
#include "servo.h"
-#include "debug.h"
+#include "debug_avr.h"
servo_s servo1;
servo_s servo2;
diff --git a/digital/beacon/src/trust.c b/digital/beacon/src/trust.c
index 340a82bd..23823ef8 100644
--- a/digital/beacon/src/trust.c
+++ b/digital/beacon/src/trust.c
@@ -25,7 +25,7 @@
#include "position.h"
#include "trust.h"
-#include "debug.h"
+#include "debug_simu.h"
extern opponent_s opponent[MAX_OBSTACLE];
diff --git a/digital/beacon/src/update.c b/digital/beacon/src/update.c
index 7a6805b0..aa1614cf 100644
--- a/digital/beacon/src/update.c
+++ b/digital/beacon/src/update.c
@@ -26,7 +26,7 @@
#include "position.h"
#include "trust.h"
#include "update.h"
-#include "debug.h"
+#include "debug_simu.h"
/* Globals Declaration */
extern opponent_s opponent[MAX_OBSTACLE];