lufa: Rename LUFA_DEBUG to TMK_LUFA_DEBUG

This commit is contained in:
tmk 2020-02-09 21:17:52 +09:00
parent ea1d7ff240
commit 6209ceebfb
5 changed files with 31 additions and 31 deletions

View file

@ -5,10 +5,10 @@ TARGET = usb_usb_debug
# LUFA debug print # LUFA debug print
# This may prevent USB enumeration and keyboard init # This may prevent USB enumeration and keyboard init
LUFA_DEBUG = yes TMK_LUFA_DEBUG = yes
# Select one of outputs for debug print # Select one of outputs for debug print
LUFA_DEBUG_UART = yes TMK_LUFA_DEBUG_UART = yes
#LUFA_DEBUG_SUART = yes #TMK_LUFA_DEBUG_SUART = yes
# USB_Host_Shield_2.0 debug print # USB_Host_Shield_2.0 debug print
# This may prevent USB enumeration and keyboard init # This may prevent USB enumeration and keyboard init

View file

@ -1,7 +1,7 @@
TARGET = usb_usb_unimap TARGET = usb_usb_unimap
UNIMAP_ENABLE = yes UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes KEYMAP_SECTION_ENABLE = yes
#LUFA_DEBUG = yes #TMK_LUFA_DEBUG = yes
#CONSOLE_ENABLE = no #CONSOLE_ENABLE = no
NO_DEBUG = yes NO_DEBUG = yes
include Makefile include Makefile

View file

@ -238,7 +238,7 @@ void hook_usb_startup_wait_loop(void)
// This situation can happen just after pluging converter into USB port. // This situation can happen just after pluging converter into USB port.
void hook_usb_suspend_loop(void) void hook_usb_suspend_loop(void)
{ {
#ifndef LUFA_DEBUG_UART #ifndef TMK_LUFA_DEBUG_UART
// This corrupts debug print when suspend // This corrupts debug print when suspend
suspend_power_down(); suspend_power_down();
#endif #endif

View file

@ -49,20 +49,20 @@ ifeq ($(MCU),atmega32u2)
TMK_LUFA_OPTS += -DNO_LIMITED_CONTROLLER_CONNECT TMK_LUFA_OPTS += -DNO_LIMITED_CONTROLLER_CONNECT
endif endif
ifeq (yes,$(strip $(LUFA_DEBUG))) ifeq (yes,$(strip $(TMK_LUFA_DEBUG)))
TMK_LUFA_OPTS += -DLUFA_DEBUG TMK_LUFA_OPTS += -DTMK_LUFA_DEBUG
endif endif
ifeq (yes,$(strip $(LUFA_DEBUG_SUART))) ifeq (yes,$(strip $(TMK_LUFA_DEBUG_SUART)))
SRC += common/avr/suart.S SRC += common/avr/suart.S
TMK_LUFA_OPTS += -DLUFA_DEBUG_SUART TMK_LUFA_OPTS += -DTMK_LUFA_DEBUG_SUART
# Keep print/debug lines when disabling HID console. See common.mk. # Keep print/debug lines when disabling HID console. See common.mk.
DEBUG_PRINT_AVAILABLE = yes DEBUG_PRINT_AVAILABLE = yes
endif endif
ifeq (yes,$(strip $(LUFA_DEBUG_UART))) ifeq (yes,$(strip $(TMK_LUFA_DEBUG_UART)))
SRC += common/avr/uart.c SRC += common/avr/uart.c
TMK_LUFA_OPTS += -DLUFA_DEBUG_UART TMK_LUFA_OPTS += -DTMK_LUFA_DEBUG_UART
# Keep print/debug lines when disabling HID console. See common.mk. # Keep print/debug lines when disabling HID console. See common.mk.
DEBUG_PRINT_AVAILABLE = yes DEBUG_PRINT_AVAILABLE = yes
endif endif

View file

@ -52,11 +52,11 @@
#include "hook.h" #include "hook.h"
#include "timer.h" #include "timer.h"
#ifdef LUFA_DEBUG_SUART #ifdef TMK_LUFA_DEBUG_SUART
#include "avr/suart.h" #include "avr/suart.h"
#endif #endif
#ifdef LUFA_DEBUG_UART #ifdef TMK_LUFA_DEBUG_UART
#include "uart.h" #include "uart.h"
#endif #endif
@ -65,7 +65,7 @@
#include "lufa.h" #include "lufa.h"
//#define LUFA_DEBUG //#define TMK_LUFA_DEBUG
uint8_t keyboard_idle = 0; uint8_t keyboard_idle = 0;
@ -265,7 +265,7 @@ static void console_task(void)
*/ */
void EVENT_USB_Device_Connect(void) void EVENT_USB_Device_Connect(void)
{ {
#ifdef LUFA_DEBUG #ifdef TMK_LUFA_DEBUG
print("[C]"); print("[C]");
#endif #endif
/* For battery powered device */ /* For battery powered device */
@ -278,7 +278,7 @@ void EVENT_USB_Device_Connect(void)
void EVENT_USB_Device_Disconnect(void) void EVENT_USB_Device_Disconnect(void)
{ {
#ifdef LUFA_DEBUG #ifdef TMK_LUFA_DEBUG
print("[D]"); print("[D]");
#endif #endif
/* For battery powered device */ /* For battery powered device */
@ -294,14 +294,14 @@ void EVENT_USB_Device_Disconnect(void)
void EVENT_USB_Device_Reset(void) void EVENT_USB_Device_Reset(void)
{ {
#ifdef LUFA_DEBUG #ifdef TMK_LUFA_DEBUG
print("[R]"); print("[R]");
#endif #endif
} }
void EVENT_USB_Device_Suspend() void EVENT_USB_Device_Suspend()
{ {
#ifdef LUFA_DEBUG #ifdef TMK_LUFA_DEBUG
print("[S]"); print("[S]");
#endif #endif
hook_usb_suspend_entry(); hook_usb_suspend_entry();
@ -309,7 +309,7 @@ void EVENT_USB_Device_Suspend()
void EVENT_USB_Device_WakeUp() void EVENT_USB_Device_WakeUp()
{ {
#ifdef LUFA_DEBUG #ifdef TMK_LUFA_DEBUG
print("[W]"); print("[W]");
#endif #endif
hook_usb_wakeup(); hook_usb_wakeup();
@ -328,7 +328,7 @@ void EVENT_USB_Device_StartOfFrame(void)
*/ */
void EVENT_USB_Device_ConfigurationChanged(void) void EVENT_USB_Device_ConfigurationChanged(void)
{ {
#ifdef LUFA_DEBUG #ifdef TMK_LUFA_DEBUG
print("[c]"); print("[c]");
#endif #endif
bool ConfigSuccess = true; bool ConfigSuccess = true;
@ -407,7 +407,7 @@ void EVENT_USB_Device_ControlRequest(void)
/* Write the report data to the control endpoint */ /* Write the report data to the control endpoint */
Endpoint_Write_Control_Stream_LE(ReportData, ReportSize); Endpoint_Write_Control_Stream_LE(ReportData, ReportSize);
Endpoint_ClearOUT(); Endpoint_ClearOUT();
#ifdef LUFA_DEBUG #ifdef TMK_LUFA_DEBUG
xprintf("[r%d]", USB_ControlRequest.wIndex); xprintf("[r%d]", USB_ControlRequest.wIndex);
#endif #endif
} }
@ -433,7 +433,7 @@ void EVENT_USB_Device_ControlRequest(void)
Endpoint_ClearOUT(); Endpoint_ClearOUT();
Endpoint_ClearStatusStage(); Endpoint_ClearStatusStage();
#ifdef LUFA_DEBUG #ifdef TMK_LUFA_DEBUG
xprintf("[L%d]", USB_ControlRequest.wIndex); xprintf("[L%d]", USB_ControlRequest.wIndex);
#endif #endif
break; break;
@ -452,7 +452,7 @@ void EVENT_USB_Device_ControlRequest(void)
Endpoint_Write_8(keyboard_protocol); Endpoint_Write_8(keyboard_protocol);
Endpoint_ClearIN(); Endpoint_ClearIN();
Endpoint_ClearStatusStage(); Endpoint_ClearStatusStage();
#ifdef LUFA_DEBUG #ifdef TMK_LUFA_DEBUG
print("[p]"); print("[p]");
#endif #endif
} }
@ -468,7 +468,7 @@ void EVENT_USB_Device_ControlRequest(void)
keyboard_protocol = (USB_ControlRequest.wValue & 0xFF); keyboard_protocol = (USB_ControlRequest.wValue & 0xFF);
clear_keyboard(); clear_keyboard();
#ifdef LUFA_DEBUG #ifdef TMK_LUFA_DEBUG
print("[P]"); print("[P]");
#endif #endif
} }
@ -482,7 +482,7 @@ void EVENT_USB_Device_ControlRequest(void)
Endpoint_ClearStatusStage(); Endpoint_ClearStatusStage();
keyboard_idle = ((USB_ControlRequest.wValue & 0xFF00) >> 8); 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); xprintf("[I%d]%d", USB_ControlRequest.wIndex, (USB_ControlRequest.wValue & 0xFF00) >> 8);
#endif #endif
} }
@ -496,7 +496,7 @@ void EVENT_USB_Device_ControlRequest(void)
Endpoint_Write_8(keyboard_idle); Endpoint_Write_8(keyboard_idle);
Endpoint_ClearIN(); Endpoint_ClearIN();
Endpoint_ClearStatusStage(); Endpoint_ClearStatusStage();
#ifdef LUFA_DEBUG #ifdef TMK_LUFA_DEBUG
print("[i]"); print("[i]");
#endif #endif
} }
@ -628,11 +628,11 @@ static void send_consumer(uint16_t data)
******************************************************************************/ ******************************************************************************/
int8_t sendchar(uint8_t c) int8_t sendchar(uint8_t c)
{ {
#ifdef LUFA_DEBUG_SUART #ifdef TMK_LUFA_DEBUG_SUART
xmit(c); xmit(c);
#endif #endif
#ifdef LUFA_DEBUG_UART #ifdef TMK_LUFA_DEBUG_UART
uart_putchar(c); uart_putchar(c);
#endif #endif
@ -672,12 +672,12 @@ int main(void)
{ {
setup_mcu(); setup_mcu();
#ifdef LUFA_DEBUG_SUART #ifdef TMK_LUFA_DEBUG_SUART
SUART_OUT_DDR |= (1<<SUART_OUT_BIT); SUART_OUT_DDR |= (1<<SUART_OUT_BIT);
SUART_OUT_PORT |= (1<<SUART_OUT_BIT); SUART_OUT_PORT |= (1<<SUART_OUT_BIT);
#endif #endif
#ifdef LUFA_DEBUG_UART #ifdef TMK_LUFA_DEBUG_UART
uart_init(115200); uart_init(115200);
#endif #endif
@ -761,7 +761,7 @@ void hook_usb_suspend_entry(void)
__attribute__((weak)) __attribute__((weak))
void hook_usb_suspend_loop(void) void hook_usb_suspend_loop(void)
{ {
#ifndef LUFA_DEBUG_UART #ifndef TMK_LUFA_DEBUG_UART
// This corrupts debug print when suspend // This corrupts debug print when suspend
suspend_power_down(); suspend_power_down();
#endif #endif