Add debug support for ATMega32.
authorbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 5 Sep 2008 15:42:24 +0000 (15:42 +0000)
committerbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 5 Sep 2008 15:42:24 +0000 (15:42 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1789 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cpu/avr/drv/kdebug_avr.c

index 886b7d6d69f4a81f53d658ad05dedae1d4e5aa18..53d91895560381dac1dcc48454d5f685b597370f 100644 (file)
@@ -63,7 +63,7 @@
         */
        #ifndef KDBG_UART0_BUS_INIT
        #define KDBG_UART0_BUS_INIT  do { \
-                       UCSR0B = BV(TXEN0); \
+                       UCR = BV(TXEN0); \
                } while (0)
        #endif
        #ifndef KDBG_UART0_BUS_RX
                #define UCR UCSR0B
                #define UDR UDR0
                #define USR UCSR0A
-       #elif CPU_AVR_ATMEGA8
-               #define UCR UCSRB
-               #define USR UCSRA
+       #elif CPU_AVR_ATMEGA8 || CPU_AVR_ATMEGA32
+               #define UCR    UCSRB
+               #define USR    UCSRA
+               #define TXEN0  TXEN
+               #define UDRE0  UDRE
+               #define TXC0   TXC
+               #define TXCIE0 TXCIE
+               #define UDRIE0 UDRIE
        #else
                #error Unknown CPU
        #endif
@@ -244,9 +249,10 @@ INLINE void kdbg_hw_init(void)
                        UBRR0H = (uint8_t)(period>>8);
                        UBRR0L = (uint8_t)period;
                        KDBG_UART0_BUS_INIT;
-               #elif CPU_AVR_ATMEGA8
+               #elif CPU_AVR_ATMEGA8 || CPU_AVR_ATMEGA32
                        UBRRH = (uint8_t)(period>>8);
                        UBRRL = (uint8_t)period;
+                       KDBG_UART0_BUS_INIT;
                #elif CPU_AVR_ATMEGA103
                        UBRR = (uint8_t)period;
                        KDBG_UART0_BUS_INIT;