aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2019-07-09 07:57:14 -0700
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-07-09 07:57:14 -0700
commit6cccc22be933d0ee59368979bc58c3a7d02e3d7b (patch)
tree435cd8dc45d7264f59806f2aaf36b25542137fe6
parent3184303037ed3344c145d2cd8751a2c550631a78 (diff)
downloadqmk_firmware-6cccc22be933d0ee59368979bc58c3a7d02e3d7b.tar.gz
qmk_firmware-6cccc22be933d0ee59368979bc58c3a7d02e3d7b.zip
Use QUANTUM_LIB_SRC for i2c_master.c inclusion (#5617)
Using QUANTUM_LIB_SRC prevents the warning when multiple sources add the i2c_master.c file. Boards such as the Ergodox EZ Glow see this warning every time they compile because the board uses the file in general, and because the RGB LED Matrix requires it, as well.
-rw-r--r--common_features.mk10
-rw-r--r--drivers/qwiic/qwiic.mk4
-rw-r--r--keyboards/ergodox_ez/rules.mk6
-rw-r--r--keyboards/model01/rules.mk4
4 files changed, 9 insertions, 15 deletions
diff --git a/common_features.mk b/common_features.mk
index 7c35f07d5..3296424a1 100644
--- a/common_features.mk
+++ b/common_features.mk
@@ -133,7 +133,7 @@ ifeq ($(strip $(LED_MATRIX_ENABLE)), IS31FL3731)
133 OPT_DEFS += -DIS31FL3731 133 OPT_DEFS += -DIS31FL3731
134 COMMON_VPATH += $(DRIVER_PATH)/issi 134 COMMON_VPATH += $(DRIVER_PATH)/issi
135 SRC += is31fl3731-simple.c 135 SRC += is31fl3731-simple.c
136 SRC += i2c_master.c 136 QUANTUM_LIB_SRC += i2c_master.c
137endif 137endif
138 138
139RGB_MATRIX_ENABLE ?= no 139RGB_MATRIX_ENABLE ?= no
@@ -157,21 +157,21 @@ ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3731)
157 OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE 157 OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE
158 COMMON_VPATH += $(DRIVER_PATH)/issi 158 COMMON_VPATH += $(DRIVER_PATH)/issi
159 SRC += is31fl3731.c 159 SRC += is31fl3731.c
160 SRC += i2c_master.c 160 QUANTUM_LIB_SRC += i2c_master.c
161endif 161endif
162 162
163ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3733) 163ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3733)
164 OPT_DEFS += -DIS31FL3733 -DSTM32_I2C -DHAL_USE_I2C=TRUE 164 OPT_DEFS += -DIS31FL3733 -DSTM32_I2C -DHAL_USE_I2C=TRUE
165 COMMON_VPATH += $(DRIVER_PATH)/issi 165 COMMON_VPATH += $(DRIVER_PATH)/issi
166 SRC += is31fl3733.c 166 SRC += is31fl3733.c
167 SRC += i2c_master.c 167 QUANTUM_LIB_SRC += i2c_master.c
168endif 168endif
169 169
170ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3737) 170ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3737)
171 OPT_DEFS += -DIS31FL3737 -DSTM32_I2C -DHAL_USE_I2C=TRUE 171 OPT_DEFS += -DIS31FL3737 -DSTM32_I2C -DHAL_USE_I2C=TRUE
172 COMMON_VPATH += $(DRIVER_PATH)/issi 172 COMMON_VPATH += $(DRIVER_PATH)/issi
173 SRC += is31fl3737.c 173 SRC += is31fl3737.c
174 SRC += i2c_master.c 174 QUANTUM_LIB_SRC += i2c_master.c
175endif 175endif
176 176
177ifeq ($(strip $(RGB_MATRIX_ENABLE)), WS2812) 177ifeq ($(strip $(RGB_MATRIX_ENABLE)), WS2812)
@@ -271,7 +271,7 @@ ifeq ($(strip $(HAPTIC_ENABLE)), DRV2605L)
271 COMMON_VPATH += $(DRIVER_PATH)/haptic 271 COMMON_VPATH += $(DRIVER_PATH)/haptic
272 SRC += haptic.c 272 SRC += haptic.c
273 SRC += DRV2605L.c 273 SRC += DRV2605L.c
274 SRC += i2c_master.c 274 QUANTUM_LIB_SRC += i2c_master.c
275 OPT_DEFS += -DHAPTIC_ENABLE 275 OPT_DEFS += -DHAPTIC_ENABLE
276 OPT_DEFS += -DDRV2605L 276 OPT_DEFS += -DDRV2605L
277endif 277endif
diff --git a/drivers/qwiic/qwiic.mk b/drivers/qwiic/qwiic.mk
index 4ae2d78e3..b23c25657 100644
--- a/drivers/qwiic/qwiic.mk
+++ b/drivers/qwiic/qwiic.mk
@@ -2,9 +2,7 @@ ifneq ($(strip $(QWIIC_ENABLE)),)
2 COMMON_VPATH += $(DRIVER_PATH)/qwiic 2 COMMON_VPATH += $(DRIVER_PATH)/qwiic
3 OPT_DEFS += -DQWIIC_ENABLE 3 OPT_DEFS += -DQWIIC_ENABLE
4 SRC += qwiic.c 4 SRC += qwiic.c
5 ifeq ($(filter "i2c_master.c", $(SRC)),) 5 QUANTUM_LIB_SRC += i2c_master.c
6 SRC += i2c_master.c
7 endif
8endif 6endif
9 7
10ifneq ($(filter JOYSTIIC, $(QWIIC_ENABLE)),) 8ifneq ($(filter JOYSTIIC, $(QWIIC_ENABLE)),)
diff --git a/keyboards/ergodox_ez/rules.mk b/keyboards/ergodox_ez/rules.mk
index e96cd2082..2882072a6 100644
--- a/keyboards/ergodox_ez/rules.mk
+++ b/keyboards/ergodox_ez/rules.mk
@@ -16,6 +16,7 @@
16 16
17# # project specific files 17# # project specific files
18SRC += matrix.c 18SRC += matrix.c
19QUANTUM_LIB_SRC += i2c_master.c
19 20
20# MCU name 21# MCU name
21MCU = atmega32u4 22MCU = atmega32u4
@@ -85,9 +86,4 @@ RGBLIGHT_ENABLE = yes
85RGB_MATRIX_ENABLE = no # enable later 86RGB_MATRIX_ENABLE = no # enable later
86DEBOUNCE_TYPE = eager_pr 87DEBOUNCE_TYPE = eager_pr
87 88
88ifeq ($(strip $(RGB_MATRIX_ENABLE)), no)
89 SRC += i2c_master.c
90endif
91
92
93LAYOUTS = ergodox 89LAYOUTS = ergodox
diff --git a/keyboards/model01/rules.mk b/keyboards/model01/rules.mk
index 49ab981d1..4345027f4 100644
--- a/keyboards/model01/rules.mk
+++ b/keyboards/model01/rules.mk
@@ -1,5 +1,5 @@
1SRC += i2c_master.c \ 1QUANTUM_LIB_SRC += i2c_master.c
2 leds.c \ 2SRC += leds.c \
3 matrix.c 3 matrix.c
4 4
5# MCU name 5# MCU name