From 16e4fd7f17c2188ec5552f87ff217cfcb88666c8 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Fri, 11 May 2012 01:51:51 +0200 Subject: uart: increase buf size --- uart.c | 7 ++++--- 1 file 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) -- cgit v1.2.1