diff options
author | David Lamparter <equinox@diac24.net> | 2012-05-11 01:51:51 +0200 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2012-05-11 01:51:51 +0200 |
commit | 16e4fd7f17c2188ec5552f87ff217cfcb88666c8 (patch) | |
tree | e5862b51a6a349856e39b6d65e7d7736634e7f0e | |
parent | aa0a617f957de3c42a217283b8cc35db669d270c (diff) |
uart: increase buf size
-rw-r--r-- | uart.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,4 +1,5 @@ -static char txbuf[64]; +#define TXBSIZE 128 +static char txbuf[TXBSIZE]; static uint8_t txput = 0, txsend = 0; ISR(USART_RX_vect) @@ -11,7 +12,7 @@ ISR(USART_UDRE_vect) if (txsend != txput) { UDR0 = txbuf[txsend]; txsend++; - txsend &= 63; + txsend &= TXBSIZE - 1; UCSR0B = (1 << RXCIE0) | (1 << UDRIE0) | (1 << RXEN0) | (1 << TXEN0); } else { UCSR0B = (1 << RXCIE0) | (1 << RXEN0) | (1 << TXEN0); @@ -22,7 +23,7 @@ static void _uart_putch(const char ch) { txbuf[txput] = ch; txput++; - txput &= 63; + txput &= TXBSIZE - 1; } static void uart_putpgm(PGM_P str) |