/* Teensyduino Core Library
* http://www.pjrc.com/teensy/
* Copyright (c) 2013 PJRC.COM, LLC.
- * Modifications by Jacob Alexander 2013-2015
+ * Modifications by Jacob Alexander 2013-2016
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* SOFTWARE.
*/
+#include <kll_defs.h>
+#if enableKeyboard_define == 1
+
// ----- Includes -----
// Compiler Includes
}
}
+ // USB Timeout, drop the packet, and potentially try something more drastic to re-enable the bus
if ( ++wait_count > TX_TIMEOUT || transmit_previous_timeout )
{
transmit_previous_timeout = 1;
- warn_print("USB Transmit Timeout...restarting device");
USBKeys_Changed = USBKeyChangeState_None; // Indicate packet lost
+ #if enableDeviceRestartOnUSBTimeout == 1
+ warn_print("USB Transmit Timeout...restarting device");
usb_device_software_reset();
+ #else
+ warn_print("USB Transmit Timeout...auto-restart disabled");
+ #endif
+ // Try to wakeup
return;
}
+
+ // Try to wake up the device if we can't allocate a packet for some reason
+ // XXX This is a bit aggressive, but seems to work well. Unfortunately, not as quick as I'd like it -HaaTa
+ usb_resume();
+
yield();
}
return;
}
+#endif
+