From 5705af4f23701ddaf781b98abeab186cf23f9130 Mon Sep 17 00:00:00 2001 From: Philip Heron Date: Mon, 24 Jan 2011 23:38:58 +0000 Subject: [PATCH] Fix baud rate calculation. Actual baud rate was slightly slower than expected. --- rtty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtty.c b/rtty.c index a8cd7a6..3d33f87 100644 --- a/rtty.c +++ b/rtty.c @@ -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 */