diff options
| author | Joel Challis <git@zvecr.com> | 2021-10-29 11:16:19 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-29 11:16:19 +0100 |
| commit | 55fb468d7453eb31bc1793772938e2d28881fcaa (patch) | |
| tree | 071269b83b618ca256ac5421b3bcddfde158b349 | |
| parent | 0f9261424097863d23b6f4835dd3f374c6776ec7 (diff) | |
| download | qmk_firmware-55fb468d7453eb31bc1793772938e2d28881fcaa.tar.gz qmk_firmware-55fb468d7453eb31bc1793772938e2d28881fcaa.zip | |
More platform/protocol alignment (#14976)
| -rw-r--r-- | builddefs/generic_features.mk | 1 | ||||
| -rw-r--r-- | common_features.mk | 7 | ||||
| -rw-r--r-- | tmk_core/common.mk | 86 | ||||
| -rw-r--r-- | tmk_core/protocol.mk | 76 |
4 files changed, 84 insertions, 86 deletions
diff --git a/builddefs/generic_features.mk b/builddefs/generic_features.mk index ff02d56bb..2281a8291 100644 --- a/builddefs/generic_features.mk +++ b/builddefs/generic_features.mk | |||
| @@ -31,6 +31,7 @@ GENERIC_FEATURES = \ | |||
| 31 | LEADER \ | 31 | LEADER \ |
| 32 | PROGRAMMABLE_BUTTON \ | 32 | PROGRAMMABLE_BUTTON \ |
| 33 | SPACE_CADET \ | 33 | SPACE_CADET \ |
| 34 | SWAP_HANDS \ | ||
| 34 | TAP_DANCE \ | 35 | TAP_DANCE \ |
| 35 | VELOCIKEY \ | 36 | VELOCIKEY \ |
| 36 | WPM \ | 37 | WPM \ |
diff --git a/common_features.mk b/common_features.mk index 1d7e955cd..0d6b86b1e 100644 --- a/common_features.mk +++ b/common_features.mk | |||
| @@ -326,6 +326,13 @@ ifneq ($(strip $(VARIABLE_TRACE)),no) | |||
| 326 | endif | 326 | endif |
| 327 | endif | 327 | endif |
| 328 | 328 | ||
| 329 | ifeq ($(strip $(SLEEP_LED_ENABLE)), yes) | ||
| 330 | SRC += $(PLATFORM_COMMON_DIR)/sleep_led.c | ||
| 331 | OPT_DEFS += -DSLEEP_LED_ENABLE | ||
| 332 | |||
| 333 | NO_SUSPEND_POWER_DOWN := yes | ||
| 334 | endif | ||
| 335 | |||
| 329 | VALID_BACKLIGHT_TYPES := pwm timer software custom | 336 | VALID_BACKLIGHT_TYPES := pwm timer software custom |
| 330 | 337 | ||
| 331 | BACKLIGHT_ENABLE ?= no | 338 | BACKLIGHT_ENABLE ?= no |
diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 8fa1a31e8..555b942c9 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk | |||
| @@ -10,92 +10,6 @@ TMK_COMMON_SRC += \ | |||
| 10 | # Use platform provided print if it exists | 10 | # Use platform provided print if it exists |
| 11 | -include $(TMK_PATH)/$(PLATFORM_COMMON_DIR)/printf.mk | 11 | -include $(TMK_PATH)/$(PLATFORM_COMMON_DIR)/printf.mk |
| 12 | 12 | ||
| 13 | SHARED_EP_ENABLE = no | ||
| 14 | MOUSE_SHARED_EP ?= yes | ||
| 15 | ifeq ($(strip $(KEYBOARD_SHARED_EP)), yes) | ||
| 16 | TMK_COMMON_DEFS += -DKEYBOARD_SHARED_EP | ||
| 17 | SHARED_EP_ENABLE = yes | ||
| 18 | # With the current usb_descriptor.c code, | ||
| 19 | # you can't share kbd without sharing mouse; | ||
| 20 | # that would be a very unexpected use case anyway | ||
| 21 | MOUSE_SHARED_EP = yes | ||
| 22 | endif | ||
| 23 | |||
| 24 | ifeq ($(strip $(MOUSE_ENABLE)), yes) | ||
| 25 | OPT_DEFS += -DMOUSE_ENABLE | ||
| 26 | ifeq ($(strip $(MOUSE_SHARED_EP)), yes) | ||
| 27 | TMK_COMMON_DEFS += -DMOUSE_SHARED_EP | ||
| 28 | SHARED_EP_ENABLE = yes | ||
| 29 | endif | ||
| 30 | endif | ||
| 31 | |||
| 32 | ifeq ($(strip $(EXTRAKEY_ENABLE)), yes) | ||
| 33 | TMK_COMMON_DEFS += -DEXTRAKEY_ENABLE | ||
| 34 | SHARED_EP_ENABLE = yes | ||
| 35 | endif | ||
| 36 | |||
| 37 | ifeq ($(strip $(RAW_ENABLE)), yes) | ||
| 38 | TMK_COMMON_DEFS += -DRAW_ENABLE | ||
| 39 | endif | ||
| 40 | |||
| 41 | ifeq ($(strip $(CONSOLE_ENABLE)), yes) | ||
| 42 | TMK_COMMON_DEFS += -DCONSOLE_ENABLE | ||
| 43 | else | ||
| 44 | # TODO: decouple this so other print backends can exist | ||
| 45 | TMK_COMMON_DEFS += -DNO_PRINT | ||
| 46 | TMK_COMMON_DEFS += -DNO_DEBUG | ||
| 47 | endif | ||
| 48 | |||
| 49 | ifeq ($(strip $(NKRO_ENABLE)), yes) | ||
| 50 | ifeq ($(PROTOCOL), VUSB) | ||
| 51 | $(info NKRO is not currently supported on V-USB, and has been disabled.) | ||
| 52 | else ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) | ||
| 53 | $(info NKRO is not currently supported with Bluetooth, and has been disabled.) | ||
| 54 | else | ||
| 55 | TMK_COMMON_DEFS += -DNKRO_ENABLE | ||
| 56 | SHARED_EP_ENABLE = yes | ||
| 57 | endif | ||
| 58 | endif | ||
| 59 | |||
| 60 | ifeq ($(strip $(RING_BUFFERED_6KRO_REPORT_ENABLE)), yes) | ||
| 61 | TMK_COMMON_DEFS += -DRING_BUFFERED_6KRO_REPORT_ENABLE | ||
| 62 | endif | ||
| 63 | |||
| 64 | ifeq ($(strip $(SLEEP_LED_ENABLE)), yes) | ||
| 65 | TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/sleep_led.c | ||
| 66 | TMK_COMMON_DEFS += -DSLEEP_LED_ENABLE | ||
| 67 | TMK_COMMON_DEFS += -DNO_SUSPEND_POWER_DOWN | ||
| 68 | endif | ||
| 69 | |||
| 70 | ifeq ($(strip $(NO_SUSPEND_POWER_DOWN)), yes) | ||
| 71 | TMK_COMMON_DEFS += -DNO_SUSPEND_POWER_DOWN | ||
| 72 | endif | ||
| 73 | |||
| 74 | ifeq ($(strip $(SWAP_HANDS_ENABLE)), yes) | ||
| 75 | TMK_COMMON_DEFS += -DSWAP_HANDS_ENABLE | ||
| 76 | endif | ||
| 77 | |||
| 78 | ifeq ($(strip $(NO_USB_STARTUP_CHECK)), yes) | ||
| 79 | TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK | ||
| 80 | endif | ||
| 81 | |||
| 82 | ifeq ($(strip $(DIGITIZER_SHARED_EP)), yes) | ||
| 83 | TMK_COMMON_DEFS += -DDIGITIZER_SHARED_EP | ||
| 84 | SHARED_EP_ENABLE = yes | ||
| 85 | endif | ||
| 86 | |||
| 87 | ifeq ($(strip $(DIGITIZER_ENABLE)), yes) | ||
| 88 | TMK_COMMON_DEFS += -DDIGITIZER_ENABLE | ||
| 89 | ifeq ($(strip $(SHARED_EP_ENABLE)), yes) | ||
| 90 | TMK_COMMON_DEFS += -DDIGITIZER_SHARED_EP | ||
| 91 | SHARED_EP_ENABLE = yes | ||
| 92 | endif | ||
| 93 | endif | ||
| 94 | |||
| 95 | ifeq ($(strip $(SHARED_EP_ENABLE)), yes) | ||
| 96 | TMK_COMMON_DEFS += -DSHARED_EP_ENABLE | ||
| 97 | endif | ||
| 98 | |||
| 99 | # Search Path | 13 | # Search Path |
| 100 | VPATH += $(TMK_PATH)/$(COMMON_DIR) | 14 | VPATH += $(TMK_PATH)/$(COMMON_DIR) |
| 101 | VPATH += $(TMK_PATH)/$(PLATFORM_COMMON_DIR) | 15 | VPATH += $(TMK_PATH)/$(PLATFORM_COMMON_DIR) |
diff --git a/tmk_core/protocol.mk b/tmk_core/protocol.mk index 359ddbfef..a8723e6b2 100644 --- a/tmk_core/protocol.mk +++ b/tmk_core/protocol.mk | |||
| @@ -6,6 +6,82 @@ TMK_COMMON_SRC += \ | |||
| 6 | $(PROTOCOL_DIR)/usb_device_state.c \ | 6 | $(PROTOCOL_DIR)/usb_device_state.c \ |
| 7 | $(PROTOCOL_DIR)/usb_util.c \ | 7 | $(PROTOCOL_DIR)/usb_util.c \ |
| 8 | 8 | ||
| 9 | SHARED_EP_ENABLE = no | ||
| 10 | MOUSE_SHARED_EP ?= yes | ||
| 11 | ifeq ($(strip $(KEYBOARD_SHARED_EP)), yes) | ||
| 12 | TMK_COMMON_DEFS += -DKEYBOARD_SHARED_EP | ||
| 13 | SHARED_EP_ENABLE = yes | ||
| 14 | # With the current usb_descriptor.c code, | ||
| 15 | # you can't share kbd without sharing mouse; | ||
| 16 | # that would be a very unexpected use case anyway | ||
| 17 | MOUSE_SHARED_EP = yes | ||
| 18 | endif | ||
| 19 | |||
| 20 | ifeq ($(strip $(MOUSE_ENABLE)), yes) | ||
| 21 | OPT_DEFS += -DMOUSE_ENABLE | ||
| 22 | ifeq ($(strip $(MOUSE_SHARED_EP)), yes) | ||
| 23 | TMK_COMMON_DEFS += -DMOUSE_SHARED_EP | ||
| 24 | SHARED_EP_ENABLE = yes | ||
| 25 | endif | ||
| 26 | endif | ||
| 27 | |||
| 28 | ifeq ($(strip $(EXTRAKEY_ENABLE)), yes) | ||
| 29 | TMK_COMMON_DEFS += -DEXTRAKEY_ENABLE | ||
| 30 | SHARED_EP_ENABLE = yes | ||
| 31 | endif | ||
| 32 | |||
| 33 | ifeq ($(strip $(RAW_ENABLE)), yes) | ||
| 34 | TMK_COMMON_DEFS += -DRAW_ENABLE | ||
| 35 | endif | ||
| 36 | |||
| 37 | ifeq ($(strip $(CONSOLE_ENABLE)), yes) | ||
| 38 | TMK_COMMON_DEFS += -DCONSOLE_ENABLE | ||
| 39 | else | ||
| 40 | # TODO: decouple this so other print backends can exist | ||
| 41 | TMK_COMMON_DEFS += -DNO_PRINT | ||
| 42 | TMK_COMMON_DEFS += -DNO_DEBUG | ||
| 43 | endif | ||
| 44 | |||
| 45 | ifeq ($(strip $(NKRO_ENABLE)), yes) | ||
| 46 | ifeq ($(PROTOCOL), VUSB) | ||
| 47 | $(info NKRO is not currently supported on V-USB, and has been disabled.) | ||
| 48 | else ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) | ||
| 49 | $(info NKRO is not currently supported with Bluetooth, and has been disabled.) | ||
| 50 | else | ||
| 51 | TMK_COMMON_DEFS += -DNKRO_ENABLE | ||
| 52 | SHARED_EP_ENABLE = yes | ||
| 53 | endif | ||
| 54 | endif | ||
| 55 | |||
| 56 | ifeq ($(strip $(RING_BUFFERED_6KRO_REPORT_ENABLE)), yes) | ||
| 57 | TMK_COMMON_DEFS += -DRING_BUFFERED_6KRO_REPORT_ENABLE | ||
| 58 | endif | ||
| 59 | |||
| 60 | ifeq ($(strip $(NO_SUSPEND_POWER_DOWN)), yes) | ||
| 61 | TMK_COMMON_DEFS += -DNO_SUSPEND_POWER_DOWN | ||
| 62 | endif | ||
| 63 | |||
| 64 | ifeq ($(strip $(NO_USB_STARTUP_CHECK)), yes) | ||
| 65 | TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK | ||
| 66 | endif | ||
| 67 | |||
| 68 | ifeq ($(strip $(DIGITIZER_SHARED_EP)), yes) | ||
| 69 | TMK_COMMON_DEFS += -DDIGITIZER_SHARED_EP | ||
| 70 | SHARED_EP_ENABLE = yes | ||
| 71 | endif | ||
| 72 | |||
| 73 | ifeq ($(strip $(DIGITIZER_ENABLE)), yes) | ||
| 74 | TMK_COMMON_DEFS += -DDIGITIZER_ENABLE | ||
| 75 | ifeq ($(strip $(SHARED_EP_ENABLE)), yes) | ||
| 76 | TMK_COMMON_DEFS += -DDIGITIZER_SHARED_EP | ||
| 77 | SHARED_EP_ENABLE = yes | ||
| 78 | endif | ||
| 79 | endif | ||
| 80 | |||
| 81 | ifeq ($(strip $(SHARED_EP_ENABLE)), yes) | ||
| 82 | TMK_COMMON_DEFS += -DSHARED_EP_ENABLE | ||
| 83 | endif | ||
| 84 | |||
| 9 | ifeq ($(strip $(USB_HID_ENABLE)), yes) | 85 | ifeq ($(strip $(USB_HID_ENABLE)), yes) |
| 10 | include $(TMK_DIR)/protocol/usb_hid.mk | 86 | include $(TMK_DIR)/protocol/usb_hid.mk |
| 11 | endif | 87 | endif |
