Fix debug port select.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 13 May 2010 12:21:10 +0000 (12:21 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 13 May 2010 12:21:10 +0000 (12:21 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3674 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cpu/avr/drv/kdebug_avr.c

index 4cdaf94e8bcab4da6641ef2fc3b1f5d4a7ac4fe3..81e78530b30ead1ed66f766447ef75d31959abf6 100644 (file)
@@ -33,7 +33,6 @@
  *
  * \brief AVR debug support (implementation).
  *
- * \version $Id$
  * \author Bernie Innocenti <bernie@codewiz.org>
  * \author Stefano Fedrigo <aleph@develer.com>
  * \author Francesco Sacchi <batt@develer.com>
@@ -246,16 +245,29 @@ INLINE void kdbg_hw_init(void)
                        #endif
 
                #elif CPU_AVR_ATMEGA168 || CPU_AVR_ATMEGA328P
-                       UBRR0H = (uint8_t)(period>>8);
-                       UBRR0L = (uint8_t)period;
-                       KDBG_UART0_BUS_INIT;
+                       #if CONFIG_KDEBUG_PORT == 0
+                               UBRR0H = (uint8_t)(period>>8);
+                               UBRR0L = (uint8_t)period;
+                               KDBG_UART0_BUS_INIT;
+                       #else
+                               #error Only CONFIG_KDEBUG_PORT 0 is supported for this cpu
+                       #endif
+
                #elif CPU_AVR_ATMEGA8 || CPU_AVR_ATMEGA32
-                       UBRRH = (uint8_t)(period>>8);
-                       UBRRL = (uint8_t)period;
-                       KDBG_UART0_BUS_INIT;
+                       #if CONFIG_KDEBUG_PORT == 0
+                               UBRRH = (uint8_t)(period>>8);
+                               UBRRL = (uint8_t)period;
+                               KDBG_UART0_BUS_INIT;
+                       #else
+                               #error Only CONFIG_KDEBUG_PORT 0 is supported for this cpu
+                       #endif
                #elif CPU_AVR_ATMEGA103
-                       UBRR = (uint8_t)period;
-                       KDBG_UART0_BUS_INIT;
+                       #if CONFIG_KDEBUG_PORT == 0
+                               UBRR = (uint8_t)period;
+                               KDBG_UART0_BUS_INIT;
+                       #else
+                               #error Only CONFIG_KDEBUG_PORT 0 is supported for this cpu
+                       #endif
                #else
                        #error Unknown CPU
                #endif