diff --git a/data/mappings/info_rules.hjson b/data/mappings/info_rules.hjson index fc25eb3328b2..5ded51b8c86c 100644 --- a/data/mappings/info_rules.hjson +++ b/data/mappings/info_rules.hjson @@ -43,7 +43,7 @@ "SPLIT_TRANSPORT": {"info_key": "split.transport.protocol", "to_c": false}, "STENO_ENABLE": {"info_key": "stenography.enabled", "value_type": "bool"}, "STENO_PROTOCOL": {"info_key": "stenography.protocol"}, - "WAIT_FOR_USB": {"info_key": "usb.wait_for", "value_type": "bool"}, + "USB_WAIT_FOR_ENUMERATION": {"info_key": "usb.wait_for_enumeration", "value_type": "bool"}, "WEAR_LEVELING_DRIVER": {"info_key": "eeprom.wear_leveling.driver"}, "WS2812_DRIVER": {"info_key": "ws2812.driver"}, diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index 25aaabcf4a3d..8a8566ddc746 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -885,7 +885,7 @@ } }, "suspend_wakeup_delay": {"$ref": "qmk.definitions.v1#/unsigned_int"}, - "wait_for": {"type": "boolean"} + "wait_for_enumeration": {"type": "boolean"} } }, "qmk": { diff --git a/docs/config_options.md b/docs/config_options.md index 045d9c07479d..fca80e54fde5 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -446,7 +446,7 @@ Use these to enable or disable building certain features. The more you have enab * Allows replacing the standard matrix scanning routine with a custom one. * `DEBOUNCE_TYPE` * Allows replacing the standard key debouncing routine with an alternative or custom one. -* `WAIT_FOR_USB` +* `USB_WAIT_FOR_ENUMERATION` * 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. diff --git a/docs/ja/config_options.md b/docs/ja/config_options.md index a349081d6a27..6cc1b6bfcd7f 100644 --- a/docs/ja/config_options.md +++ b/docs/ja/config_options.md @@ -378,7 +378,7 @@ QMK での全ての利用可能な設定にはデフォルトがあります。 * 標準マトリックス走査ルーチンを独自のものに置き換えることができます。 * `DEBOUNCE_TYPE` * 標準キーデバウンスルーチンを代替または独自のものに置き換えることができます。 -* `WAIT_FOR_USB` +* `USB_WAIT_FOR_ENUMERATION` * キーボードが起動する前に、USB 接続が確立されるのをキーボードに待機させます * `NO_USB_STARTUP_CHECK` * キーボードの起動後の usb サスペンドチェックを無効にします。通常、キーボードはタスクが実行される前にホストがウェイク アップするのを待ちます。分割キーボードは半分はウェイクアップコールを取得できませんが、マスタにコマンドを送信する必要があるため、役に立ちます。 diff --git a/docs/reference_info_json.md b/docs/reference_info_json.md index e6bc34e79ec1..6f0b84c414b7 100644 --- a/docs/reference_info_json.md +++ b/docs/reference_info_json.md @@ -833,7 +833,7 @@ Configures the [Stenography](feature_stenography.md) feature. * `suspend_wakeup_delay` * The amount of time to wait after sending a wakeup packet, in milliseconds. * Default: `0` (disabled) - * `wait_for` + * `wait_for_enumeration` * Force the keyboard to wait for USB enumeration before starting up. * Default: `false` diff --git a/keyboards/converter/hp_46010a/keyboard.json b/keyboards/converter/hp_46010a/keyboard.json index f9a855c870ac..45193069813d 100644 --- a/keyboards/converter/hp_46010a/keyboard.json +++ b/keyboards/converter/hp_46010a/keyboard.json @@ -7,7 +7,7 @@ "vid": "0xFEED", "pid": "0x6060", "device_version": "0.0.1", - "wait_for": true + "wait_for_enumeration": true }, "processor": "atmega32u4", "bootloader": "halfkay", diff --git a/keyboards/geekboards/macropad_v2/keyboard.json b/keyboards/geekboards/macropad_v2/keyboard.json index fe369b296e17..54d779570a65 100644 --- a/keyboards/geekboards/macropad_v2/keyboard.json +++ b/keyboards/geekboards/macropad_v2/keyboard.json @@ -7,7 +7,7 @@ "vid": "0x0483", "pid": "0xA372", "device_version": "0.0.2", - "wait_for": true + "wait_for_enumeration": true }, "qmk": { "tap_keycode_delay": 10 diff --git a/keyboards/ristretto/keyboard.json b/keyboards/ristretto/keyboard.json index 023d0000d46b..e8e812b7d2f5 100644 --- a/keyboards/ristretto/keyboard.json +++ b/keyboards/ristretto/keyboard.json @@ -7,7 +7,7 @@ "vid": "0x666B", "pid": "0x7273", "device_version": "0.0.1", - "wait_for": true + "wait_for_enumeration": true }, "features": { "bootmagic": false, diff --git a/tmk_core/protocol.mk b/tmk_core/protocol.mk index 6439cdced6f2..796b4e878713 100644 --- a/tmk_core/protocol.mk +++ b/tmk_core/protocol.mk @@ -66,8 +66,8 @@ ifeq ($(strip $(NO_USB_STARTUP_CHECK)), yes) OPT_DEFS += -DNO_USB_STARTUP_CHECK endif -ifeq ($(strip $(WAIT_FOR_USB)), yes) - OPT_DEFS += -DWAIT_FOR_USB +ifeq ($(strip $(USB_WAIT_FOR_ENUMERATION)), yes) + OPT_DEFS += -DUSB_WAIT_FOR_ENUMERATION endif ifeq ($(strip $(JOYSTICK_SHARED_EP)), yes) diff --git a/tmk_core/protocol/chibios/chibios.c b/tmk_core/protocol/chibios/chibios.c index a02097785f4d..a249af8d38cc 100644 --- a/tmk_core/protocol/chibios/chibios.c +++ b/tmk_core/protocol/chibios/chibios.c @@ -51,6 +51,11 @@ #define USB_GETSTATUS_REMOTE_WAKEUP_ENABLED (2U) +#ifdef WAIT_FOR_USB +// TODO: Remove backwards compatibility with old define +# define USB_WAIT_FOR_ENUMERATION +#endif + /* ------------------------- * TMK host driver defs * ------------------------- @@ -143,7 +148,7 @@ void protocol_pre_init(void) { /* Wait until USB is active */ while (true) { -#if defined(WAIT_FOR_USB) +#if defined(USB_WAIT_FOR_ENUMERATION) if (USB_DRIVER.state == USB_ACTIVE) { driver = &chibios_driver; break; diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index d6f0c69b6b0d..2142b04460a1 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -67,6 +67,11 @@ # include "raw_hid.h" #endif +#ifdef WAIT_FOR_USB +// TODO: Remove backwards compatibility with old define +# define USB_WAIT_FOR_ENUMERATION +#endif + uint8_t keyboard_idle = 0; /* 0: Boot Protocol, 1: Report Protocol(default) */ uint8_t keyboard_protocol = 1; @@ -807,7 +812,7 @@ void protocol_pre_init(void) { /* wait for USB startup & debug output */ -#ifdef WAIT_FOR_USB +#ifdef USB_WAIT_FOR_ENUMERATION while (USB_DeviceState != DEVICE_STATE_Configured) { # if defined(INTERRUPT_CONTROL_ENDPOINT) ;