X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=tmk_core%2Fprotocol%2Flufa%2Flufa.c;h=aecaa050af52572fd2c56c7b06b14b7211d19610;hb=dd7b75040a7f3cc62fe58d6d4b3cc2a331d487b3;hp=b5d0b50e7b1de376798a68a1d8266ee836f7c364;hpb=feebc2356304ef45ed12924673bd09ae20acb113;p=max%2Ftmk_keyboard.git diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index b5d0b50e..aecaa050 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -56,6 +56,10 @@ #include "avr/suart.h" #endif +#ifdef LUFA_DEBUG_UART +#include "uart.h" +#endif + #include "matrix.h" #include "descriptor.h" #include "lufa.h" @@ -218,7 +222,9 @@ static void console_task(void) */ void EVENT_USB_Device_Connect(void) { +#ifdef LUFA_DEBUG print("[C]"); +#endif /* For battery powered device */ if (!USB_IsInitialized) { USB_Disable(); @@ -229,7 +235,9 @@ void EVENT_USB_Device_Connect(void) void EVENT_USB_Device_Disconnect(void) { +#ifdef LUFA_DEBUG print("[D]"); +#endif /* For battery powered device */ USB_IsInitialized = false; /* TODO: This doesn't work. After several plug in/outs can not be enumerated. @@ -575,25 +583,22 @@ static void send_consumer(uint16_t data) /******************************************************************************* * sendchar ******************************************************************************/ -#ifdef CONSOLE_ENABLE int8_t sendchar(uint8_t c) { #ifdef LUFA_DEBUG_SUART xmit(c); #endif - bool r = console_putc(c); - return (r ? 0 : -1); -} -#else -int8_t sendchar(uint8_t c) -{ - #ifdef LUFA_DEBUG_SUART - xmit(c); + #ifdef LUFA_DEBUG_UART + uart_putchar(c); + #endif + + #ifdef CONSOLE_ENABLE + console_putc(c); #endif + return 0; } -#endif /******************************************************************************* @@ -629,11 +634,15 @@ int main(void) SUART_OUT_PORT |= (1<