diff options
| author | Drashna Jaelre <drashna@live.com> | 2021-11-14 22:03:24 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-14 22:03:24 -0800 |
| commit | 56e3f06a26851976e559aacf7a096c61403304be (patch) | |
| tree | 1e9ec98ad239fdd241e77ac4c4822fc2721a9cea /common_features.mk | |
| parent | 462c3a615113e84ac3ca837a5caeb928c0ec8505 (diff) | |
| download | qmk_firmware-56e3f06a26851976e559aacf7a096c61403304be.tar.gz qmk_firmware-56e3f06a26851976e559aacf7a096c61403304be.zip | |
Rework and expand Pointing Device support (#14343)
Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com>
Diffstat (limited to 'common_features.mk')
| -rw-r--r-- | common_features.mk | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/common_features.mk b/common_features.mk index 7abdce302..896fbb012 100644 --- a/common_features.mk +++ b/common_features.mk | |||
| @@ -107,10 +107,43 @@ ifeq ($(strip $(MOUSEKEY_ENABLE)), yes) | |||
| 107 | SRC += $(QUANTUM_DIR)/mousekey.c | 107 | SRC += $(QUANTUM_DIR)/mousekey.c |
| 108 | endif | 108 | endif |
| 109 | 109 | ||
| 110 | VALID_POINTING_DEVICE_DRIVER_TYPES := adns5050 adns9800 analog_joystick cirque_pinnacle_i2c cirque_pinnacle_spi pmw3360 pimoroni_trackball custom | ||
| 111 | POINTING_DEVICE_DRIVER ?= custom | ||
| 110 | ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes) | 112 | ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes) |
| 111 | OPT_DEFS += -DPOINTING_DEVICE_ENABLE | 113 | ifeq ($(filter $(POINTING_DEVICE_DRIVER),$(VALID_POINTING_DEVICE_DRIVER_TYPES)),) |
| 112 | MOUSE_ENABLE := yes | 114 | $(error POINTING_DEVICE_DRIVER="$(POINTING_DEVICE_DRIVER)" is not a valid pointing device type) |
| 113 | SRC += $(QUANTUM_DIR)/pointing_device.c | 115 | else |
| 116 | OPT_DEFS += -DPOINTING_DEVICE_ENABLE | ||
| 117 | MOUSE_ENABLE := yes | ||
| 118 | SRC += $(QUANTUM_DIR)/pointing_device.c | ||
| 119 | SRC += $(QUANTUM_DIR)/pointing_device_drivers.c | ||
| 120 | ifneq ($(strip $(POINTING_DEVICE_DRIVER)), custom) | ||
| 121 | SRC += drivers/sensors/$(strip $(POINTING_DEVICE_DRIVER)).c | ||
| 122 | OPT_DEFS += -DPOINTING_DEVICE_DRIVER_$(strip $(shell echo $(POINTING_DEVICE_DRIVER) | tr '[:lower:]' '[:upper:]')) | ||
| 123 | endif | ||
| 124 | OPT_DEFS += -DPOINTING_DEVICE_DRIVER_$(strip $(POINTING_DEVICE_DRIVER)) | ||
| 125 | ifeq ($(strip $(POINTING_DEVICE_DRIVER)), adns9800) | ||
| 126 | OPT_DEFS += -DSTM32_SPI -DHAL_USE_SPI=TRUE | ||
| 127 | QUANTUM_LIB_SRC += spi_master.c | ||
| 128 | else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), analog_joystick) | ||
| 129 | OPT_DEFS += -DSTM32_ADC -DHAL_USE_ADC=TRUE | ||
| 130 | LIB_SRC += analog.c | ||
| 131 | else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), cirque_pinnacle_i2c) | ||
| 132 | OPT_DEFS += -DSTM32_I2C -DHAL_USE_I2C=TRUE | ||
| 133 | SRC += drivers/sensors/cirque_pinnacle.c | ||
| 134 | QUANTUM_LIB_SRC += i2c_master.c | ||
| 135 | else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), cirque_pinnacle_spi) | ||
| 136 | OPT_DEFS += -DSTM32_SPI -DHAL_USE_SPI=TRUE | ||
| 137 | SRC += drivers/sensors/cirque_pinnacle.c | ||
| 138 | QUANTUM_LIB_SRC += spi_master.c | ||
| 139 | else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), pimoroni_trackball) | ||
| 140 | OPT_DEFS += -DSTM32_SPI -DHAL_USE_I2C=TRUE | ||
| 141 | QUANTUM_LIB_SRC += i2c_master.c | ||
| 142 | else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), pmw3360) | ||
| 143 | OPT_DEFS += -DSTM32_SPI -DHAL_USE_SPI=TRUE | ||
| 144 | QUANTUM_LIB_SRC += spi_master.c | ||
| 145 | endif | ||
| 146 | endif | ||
| 114 | endif | 147 | endif |
| 115 | 148 | ||
| 116 | VALID_EEPROM_DRIVER_TYPES := vendor custom transient i2c spi | 149 | VALID_EEPROM_DRIVER_TYPES := vendor custom transient i2c spi |
