From e9e5371a9d12d313525fb8ce91886e79f9c7bba2 Mon Sep 17 00:00:00 2001 From: asterix Date: Thu, 13 May 2010 12:21:10 +0000 Subject: [PATCH] Fix debug port select. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3674 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cpu/avr/drv/kdebug_avr.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/bertos/cpu/avr/drv/kdebug_avr.c b/bertos/cpu/avr/drv/kdebug_avr.c index 4cdaf94e..81e78530 100644 --- a/bertos/cpu/avr/drv/kdebug_avr.c +++ b/bertos/cpu/avr/drv/kdebug_avr.c @@ -33,7 +33,6 @@ * * \brief AVR debug support (implementation). * - * \version $Id$ * \author Bernie Innocenti * \author Stefano Fedrigo * \author Francesco Sacchi @@ -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 -- 2.25.1