aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core/protocol/chibios/main.c
diff options
context:
space:
mode:
authorGravatar yiancar <yiangosyiangou@cytanet.com.cy>2018-08-24 15:38:31 +0300
committerGravatar Jack Humbert <jack.humb@gmail.com>2018-09-05 09:42:04 -0400
commit73a3399d0ef7e06db70fc2964a3f2a35e9aca25d (patch)
treedf36ad4301d9eb93ee051d023bafaf2fccab90eb /tmk_core/protocol/chibios/main.c
parent1a907a1627796468c5d93c091168fede5893bbc7 (diff)
downloadqmk_firmware-73a3399d0ef7e06db70fc2964a3f2a35e9aca25d.tar.gz
Add the ability to disable the USB startup check for Chibios
- Added support for NO_USB_STARTUP_CHECK. This allows the keyboard do function and not get stuck in a SUSPENDED state loop in case of no USB connection. - Added support for WAIT_FOR_USB. In LUFA no keyboard has this flag enable therefor no keyboard waits for usb to be active. - Added documentation for both configuration flags as they were missing.
Diffstat (limited to 'tmk_core/protocol/chibios/main.c')
-rw-r--r--tmk_core/protocol/chibios/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c
index 568c1edb2..dcc6d9d07 100644
--- a/tmk_core/protocol/chibios/main.c
+++ b/tmk_core/protocol/chibios/main.c
@@ -142,10 +142,15 @@ int main(void) {
/* Wait until the USB or serial link is active */
while (true) {
+#if defined(WAIT_FOR_USB) || defined(SERIAL_LINK_ENABLE)
if(USB_DRIVER.state == USB_ACTIVE) {
driver = &chibios_driver;
break;
}
+#else
+ driver = &chibios_driver;
+ break;
+#endif
#ifdef SERIAL_LINK_ENABLE
if(is_serial_link_connected()) {
driver = get_serial_link_driver();
@@ -178,6 +183,7 @@ int main(void) {
/* Main loop */
while(true) {
+#if !defined(NO_USB_STARTUP_CHECK)
if(USB_DRIVER.state == USB_SUSPENDED) {
print("[s]");
#ifdef VISUALIZER_ENABLE
@@ -205,6 +211,7 @@ int main(void) {
visualizer_resume();
#endif
}
+#endif
keyboard_task();
#ifdef CONSOLE_ENABLE