From 9d40be19908394e44cdda5d3c73d21e8d3795e72 Mon Sep 17 00:00:00 2001 From: tmk Date: Tue, 19 Nov 2013 03:20:25 +0900 Subject: Wait for USB starting up to make debug print available --- protocol/lufa/lufa.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'protocol') diff --git a/protocol/lufa/lufa.c b/protocol/lufa/lufa.c index a230d5ba20..04e8e78f38 100644 --- a/protocol/lufa/lufa.c +++ b/protocol/lufa/lufa.c @@ -539,11 +539,18 @@ int main(void) { SetupHardware(); sei(); + + /* wait for USB startup & debug output */ + while (USB_DeviceState != DEVICE_STATE_Configured) { #if defined(INTERRUPT_CONTROL_ENDPOINT) - while (USB_DeviceState != DEVICE_STATE_Configured) ; + ; +#else + USB_USBTask(); #endif + } print("USB configured.\n"); + /* init modules */ keyboard_init(); host_set_driver(&lufa_driver); #ifdef SLEEP_LED_ENABLE -- cgit v1.2.1