diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 60849aea..4dce8adc 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -43,6 +43,7 @@ #include "action.h" #include "led.h" #include "sendchar.h" +#include "ringbuf.h" #include "debug.h" #ifdef SLEEP_LED_ENABLE #include "sleep_led.h" @@ -89,60 +90,97 @@ host_driver_t lufa_driver = { * Console ******************************************************************************/ #ifdef CONSOLE_ENABLE -static void Console_Task(void) +#define SENDBUF_SIZE 256 +static uint8_t sbuf[SENDBUF_SIZE]; +static ringbuf_t sendbuf = { + .buffer = sbuf, + .head = 0, + .tail = 0, + .size_mask = SENDBUF_SIZE - 1 +}; + +static bool console_putc(uint8_t c) +{ + // return immediately if called while interrupt + if (!(SREG & (1<