summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2012-05-11 01:51:51 +0200
committerDavid Lamparter <equinox@diac24.net>2012-05-11 01:51:51 +0200
commit16e4fd7f17c2188ec5552f87ff217cfcb88666c8 (patch)
treee5862b51a6a349856e39b6d65e7d7736634e7f0e
parentaa0a617f957de3c42a217283b8cc35db669d270c (diff)
uart: increase buf size
-rw-r--r--uart.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/uart.c b/uart.c
index df3243f..fcc5783 100644
--- a/uart.c
+++ b/uart.c
@@ -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)