# HG changeset patch # User Daniel O'Connor # Date 1293873214 -37800 # Node ID f0b4314b91ecc964b83990079297e858a5613d7f # Parent 5f21a1c8ca061a4f050696b11debc85b635b65b4 Fix for dual UART devices. diff -r 5f21a1c8ca06 -r f0b4314b91ec cons-reg.h --- a/cons-reg.h Tue May 12 08:44:30 2009 +0930 +++ b/cons-reg.h Sat Jan 01 19:43:34 2011 +1030 @@ -27,12 +27,13 @@ */ /* Decide what registers and ISRs to use */ - -#ifdef UBRR0 +#ifdef UBRR0L /* Dual UART devices (eg ATMega324p) */ #define _SETBAUD(x) do { \ - UBRR0 = UART_BAUD_SELECT(x, F_CPU); \ + UBRR0L = (UART_BAUD_SELECT(x, F_CPU) & 0xff); \ + UBRR0H = (UART_BAUD_SELECT(x, F_CPU) << 8) & 0xff; \ } while(0) + #define _INITREG() do { \ UCSR0A = 0; \ UCSR0B = _BV(RXEN0) | _BV(TXEN0) | _BV(RXCIE0); \