]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Add the ability to disable the USB startup check for Chibios
authoryiancar <yiangosyiangou@cytanet.com.cy>
Fri, 24 Aug 2018 12:38:31 +0000 (15:38 +0300)
committerJack Humbert <jack.humb@gmail.com>
Wed, 5 Sep 2018 13:42:04 +0000 (09:42 -0400)
- 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.

docs/config_options.md
tmk_core/protocol/chibios/main.c

index e978bcce82144ef9c872283764b3201582a7f2b7..eaaa59872c7552f55274c85d575d36714cc13550 100644 (file)
@@ -248,3 +248,7 @@ Use these to enable or disable building certain features. The more you have enab
   * Enable Bluetooth with the Adafruit EZ-Key HID
 * `SPLIT_KEYBOARD`
   * Enables split keyboard support (dual MCU like the let's split and bakingpy's boards) and includes all necessary files located at quantum/split_common
+* `WAIT_FOR_USB`
+  * Forces the keyboard to wait for a USB connection to be established before it starts up
+* `NO_USB_STARTUP_CHECK`
+  * Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master.
index 568c1edb28772f576c0480743770a5dd0b30bea0..dcc6d9d07642e2f2c9fad658d0979b35ca5c5364 100644 (file)
@@ -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