Fix baud rate calculation. Actual baud rate was slightly slower than expected.

master
Philip Heron 2011-01-24 23:38:58 +00:00
rodzic 9a69adc45a
commit 5705af4f23
1 zmienionych plików z 1 dodań i 1 usunięć

2
rtty.c
Wyświetl plik

@ -64,7 +64,7 @@ void rtx_init(void)
/* RTTY is driven by TIMER0 in CTC mode */
TCCR0A = _BV(WGM01); /* Mode 2, CTC */
TCCR0B = _BV(CS02) | _BV(CS00); /* prescaler 1024 */
OCR0A = F_CPU / 1024 / RTTY_BAUD;
OCR0A = F_CPU / 1024 / RTTY_BAUD - 1;
TIMSK0 = _BV(OCIE0A); /* Enable interrupt */
/* We use Port B pins 1 and 2 */