X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=tmk_core%2Fcommon%2Favr%2Fuart.c;h=0fec705f9e3b230b5992c4eeb1e11618ef4140c9;hb=47775af20671e347e7e5545f63b42a51f0a4df04;hp=d9d42390230be79192e175511c6fb98fc664b7ef;hpb=c41e48a0ab0712d2667feb6b5dd8a4d5491cfcc5;p=max%2Ftmk_keyboard.git diff --git a/tmk_core/common/avr/uart.c b/tmk_core/common/avr/uart.c index d9d42390..0fec705f 100644 --- a/tmk_core/common/avr/uart.c +++ b/tmk_core/common/avr/uart.c @@ -66,7 +66,7 @@ // These buffers may be any size from 2 to 256 bytes. #define RX_BUFFER_SIZE 64 -#define TX_BUFFER_SIZE 40 +#define TX_BUFFER_SIZE 256 static volatile uint8_t tx_buffer[TX_BUFFER_SIZE]; static volatile uint8_t tx_buffer_head; @@ -95,6 +95,8 @@ void uart_putchar(uint8_t c) i = tx_buffer_head + 1; if (i >= TX_BUFFER_SIZE) i = 0; + // return immediately to avoid deadlock when interrupt is disabled(called from ISR) + if (tx_buffer_tail == i && (SREG & (1<