summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-11-19 03:20:25 +0900
committertmk <nobody@nowhere>2013-11-19 03:20:25 +0900
commit9d40be19908394e44cdda5d3c73d21e8d3795e72 (patch)
tree5dbfb3a3182f35a2a4a15a26736388e87c2f42d3
parent676d94d13791a99751cebf724fd5a56b150f344d (diff)
downloadqmk_firmware-9d40be19908394e44cdda5d3c73d21e8d3795e72.tar.gz
qmk_firmware-9d40be19908394e44cdda5d3c73d21e8d3795e72.zip
Wait for USB starting up to make debug print available
-rw-r--r--common/action_util.h1
-rw-r--r--protocol/lufa/lufa.c9
2 files changed, 9 insertions, 1 deletions
diff --git a/common/action_util.h b/common/action_util.h
index 939bc2b662..f9d3161a80 100644
--- a/common/action_util.h
+++ b/common/action_util.h
@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define ACTION_UTIL_H
#include <stdint.h>
+#include "report.h"
extern report_keyboard_t *keyboard_report;
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