kopia lustrzana https://github.com/fsphil/hadie
Fix baud rate calculation. Actual baud rate was slightly slower than expected.
rodzic
9a69adc45a
commit
5705af4f23
2
rtty.c
2
rtty.c
|
@ -64,7 +64,7 @@ void rtx_init(void)
|
||||||
/* RTTY is driven by TIMER0 in CTC mode */
|
/* RTTY is driven by TIMER0 in CTC mode */
|
||||||
TCCR0A = _BV(WGM01); /* Mode 2, CTC */
|
TCCR0A = _BV(WGM01); /* Mode 2, CTC */
|
||||||
TCCR0B = _BV(CS02) | _BV(CS00); /* prescaler 1024 */
|
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 */
|
TIMSK0 = _BV(OCIE0A); /* Enable interrupt */
|
||||||
|
|
||||||
/* We use Port B pins 1 and 2 */
|
/* We use Port B pins 1 and 2 */
|
||||||
|
|
Ładowanie…
Reference in New Issue