aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/config_options.md4
-rw-r--r--tmk_core/protocol/chibios/main.c7
2 files changed, 11 insertions, 0 deletions
diff --git a/docs/config_options.md b/docs/config_options.md
index e978bcce8..eaaa59872 100644
--- a/docs/config_options.md
+++ b/docs/config_options.md
@@ -248,3 +248,7 @@ Use these to enable or disable building certain features. The more you have enab
248 * Enable Bluetooth with the Adafruit EZ-Key HID 248 * Enable Bluetooth with the Adafruit EZ-Key HID
249* `SPLIT_KEYBOARD` 249* `SPLIT_KEYBOARD`
250 * 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 250 * 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
251* `WAIT_FOR_USB`
252 * Forces the keyboard to wait for a USB connection to be established before it starts up
253* `NO_USB_STARTUP_CHECK`
254 * 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.
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) {
142 142
143 /* Wait until the USB or serial link is active */ 143 /* Wait until the USB or serial link is active */
144 while (true) { 144 while (true) {
145#if defined(WAIT_FOR_USB) || defined(SERIAL_LINK_ENABLE)
145 if(USB_DRIVER.state == USB_ACTIVE) { 146 if(USB_DRIVER.state == USB_ACTIVE) {
146 driver = &chibios_driver; 147 driver = &chibios_driver;
147 break; 148 break;
148 } 149 }
150#else
151 driver = &chibios_driver;
152 break;
153#endif
149#ifdef SERIAL_LINK_ENABLE 154#ifdef SERIAL_LINK_ENABLE
150 if(is_serial_link_connected()) { 155 if(is_serial_link_connected()) {
151 driver = get_serial_link_driver(); 156 driver = get_serial_link_driver();
@@ -178,6 +183,7 @@ int main(void) {
178 /* Main loop */ 183 /* Main loop */
179 while(true) { 184 while(true) {
180 185
186#if !defined(NO_USB_STARTUP_CHECK)
181 if(USB_DRIVER.state == USB_SUSPENDED) { 187 if(USB_DRIVER.state == USB_SUSPENDED) {
182 print("[s]"); 188 print("[s]");
183#ifdef VISUALIZER_ENABLE 189#ifdef VISUALIZER_ENABLE
@@ -205,6 +211,7 @@ int main(void) {
205 visualizer_resume(); 211 visualizer_resume();
206#endif 212#endif
207 } 213 }
214#endif
208 215
209 keyboard_task(); 216 keyboard_task();
210#ifdef CONSOLE_ENABLE 217#ifdef CONSOLE_ENABLE