X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=tmk_core%2Fprotocol%2Flufa%2Flufa.c;h=54221591b388b3729077b68ac23cabe6b624ae7e;hb=c6a6049bc85609b05a6502dbbed524d669b2b7a5;hp=ac05e75b4bdfa81bba253e06911e883f385dcb36;hpb=91a125baebd5e1e50be62b7043285987c4c344a4;p=max%2Ftmk_keyboard.git diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index ac05e75b..54221591 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -52,11 +52,11 @@ #include "hook.h" #include "timer.h" -#ifdef LUFA_DEBUG_SUART +#ifdef TMK_LUFA_DEBUG_SUART #include "avr/suart.h" #endif -#ifdef LUFA_DEBUG_UART +#ifdef TMK_LUFA_DEBUG_UART #include "uart.h" #endif @@ -65,7 +65,7 @@ #include "lufa.h" -//#define LUFA_DEBUG +//#define TMK_LUFA_DEBUG uint8_t keyboard_idle = 0; @@ -265,20 +265,19 @@ static void console_task(void) */ void EVENT_USB_Device_Connect(void) { -#ifdef LUFA_DEBUG +#ifdef TMK_LUFA_DEBUG print("[C]"); #endif /* For battery powered device */ if (!USB_IsInitialized) { USB_Disable(); USB_Init(); - USB_Device_EnableSOFEvents(); } } void EVENT_USB_Device_Disconnect(void) { -#ifdef LUFA_DEBUG +#ifdef TMK_LUFA_DEBUG print("[D]"); #endif /* For battery powered device */ @@ -294,14 +293,14 @@ void EVENT_USB_Device_Disconnect(void) void EVENT_USB_Device_Reset(void) { -#ifdef LUFA_DEBUG +#ifdef TMK_LUFA_DEBUG print("[R]"); #endif } void EVENT_USB_Device_Suspend() { -#ifdef LUFA_DEBUG +#ifdef TMK_LUFA_DEBUG print("[S]"); #endif hook_usb_suspend_entry(); @@ -309,17 +308,12 @@ void EVENT_USB_Device_Suspend() void EVENT_USB_Device_WakeUp() { -#ifdef LUFA_DEBUG +#ifdef TMK_LUFA_DEBUG print("[W]"); #endif hook_usb_wakeup(); } -// called every 1ms -void EVENT_USB_Device_StartOfFrame(void) -{ -} - /** Event handler for the USB_ConfigurationChanged event. * This is fired when the host sets the current configuration of the USB device after enumeration. * @@ -328,7 +322,7 @@ void EVENT_USB_Device_StartOfFrame(void) */ void EVENT_USB_Device_ConfigurationChanged(void) { -#ifdef LUFA_DEBUG +#ifdef TMK_LUFA_DEBUG print("[c]"); #endif bool ConfigSuccess = true; @@ -407,7 +401,7 @@ void EVENT_USB_Device_ControlRequest(void) /* Write the report data to the control endpoint */ Endpoint_Write_Control_Stream_LE(ReportData, ReportSize); Endpoint_ClearOUT(); -#ifdef LUFA_DEBUG +#ifdef TMK_LUFA_DEBUG xprintf("[r%d]", USB_ControlRequest.wIndex); #endif } @@ -433,7 +427,7 @@ void EVENT_USB_Device_ControlRequest(void) Endpoint_ClearOUT(); Endpoint_ClearStatusStage(); -#ifdef LUFA_DEBUG +#ifdef TMK_LUFA_DEBUG xprintf("[L%d]", USB_ControlRequest.wIndex); #endif break; @@ -452,7 +446,7 @@ void EVENT_USB_Device_ControlRequest(void) Endpoint_Write_8(keyboard_protocol); Endpoint_ClearIN(); Endpoint_ClearStatusStage(); -#ifdef LUFA_DEBUG +#ifdef TMK_LUFA_DEBUG print("[p]"); #endif } @@ -468,7 +462,7 @@ void EVENT_USB_Device_ControlRequest(void) keyboard_protocol = (USB_ControlRequest.wValue & 0xFF); clear_keyboard(); -#ifdef LUFA_DEBUG +#ifdef TMK_LUFA_DEBUG print("[P]"); #endif } @@ -482,7 +476,7 @@ void EVENT_USB_Device_ControlRequest(void) Endpoint_ClearStatusStage(); keyboard_idle = ((USB_ControlRequest.wValue & 0xFF00) >> 8); -#ifdef LUFA_DEBUG +#ifdef TMK_LUFA_DEBUG xprintf("[I%d]%d", USB_ControlRequest.wIndex, (USB_ControlRequest.wValue & 0xFF00) >> 8); #endif } @@ -496,7 +490,7 @@ void EVENT_USB_Device_ControlRequest(void) Endpoint_Write_8(keyboard_idle); Endpoint_ClearIN(); Endpoint_ClearStatusStage(); -#ifdef LUFA_DEBUG +#ifdef TMK_LUFA_DEBUG print("[i]"); #endif } @@ -628,11 +622,11 @@ static void send_consumer(uint16_t data) ******************************************************************************/ int8_t sendchar(uint8_t c) { - #ifdef LUFA_DEBUG_SUART + #ifdef TMK_LUFA_DEBUG_SUART xmit(c); #endif - #ifdef LUFA_DEBUG_UART + #ifdef TMK_LUFA_DEBUG_UART uart_putchar(c); #endif @@ -663,8 +657,6 @@ static void setup_usb(void) USB_Disable(); USB_Init(); - - USB_Device_EnableSOFEvents(); } int main(void) __attribute__ ((weak)); @@ -672,12 +664,12 @@ int main(void) { setup_mcu(); -#ifdef LUFA_DEBUG_SUART +#ifdef TMK_LUFA_DEBUG_SUART SUART_OUT_DDR |= (1<