Mercurial > ~darius > hgwebdir.cgi > avr-lib
changeset 10:f0b4314b91ec
Fix for dual UART devices.
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Sat, 01 Jan 2011 19:43:34 +1030 |
parents | 5f21a1c8ca06 |
children | b46f0c742316 |
files | cons-reg.h |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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); \