Revision a7a56246
Fixed U2X1 being set in the wrong control register
toolbox/serial.c | ||
---|---|---|
1 | 1 |
#include "serial.h" |
2 | 2 |
#include <avr/io.h> |
3 | 3 |
#include <avr/interrupt.h> |
4 |
#include <util/atomic.h> |
|
5 | 4 |
|
6 | 5 |
static int rx_start = 0, rx_end = 0; |
7 | 6 |
static char rx_buffer[RX_BUFFER_SIZE]; |
... | ... | |
30 | 29 |
// USBS = 0, 1 stop bit |
31 | 30 |
// UCSZ = 3, 8-bit |
32 | 31 |
// U2X = 1, use 8 prescale instead of 16 for a more accurate baud rate |
33 |
UCSR1B = _BV(RXCIE1) | _BV(RXEN1) | _BV(TXEN1) | _BV(U2X1); |
|
32 |
UCSR1A = _BV(U2X1); |
|
33 |
UCSR1B = _BV(RXCIE1) | _BV(RXEN1) | _BV(TXEN1); |
|
34 | 34 |
UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); |
35 | 35 |
} |
36 | 36 |
|
Also available in: Unified diff