]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Use QUANTUM_LIB_SRC for i2c_master.c inclusion (#5617)
authorDrashna Jaelre <drashna@live.com>
Tue, 9 Jul 2019 14:57:14 +0000 (07:57 -0700)
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>
Tue, 9 Jul 2019 14:57:14 +0000 (07:57 -0700)
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.

common_features.mk
drivers/qwiic/qwiic.mk
keyboards/ergodox_ez/rules.mk
keyboards/model01/rules.mk

index 7c35f07d52c9199a2c72403ba44abc037b684f08..3296424a11eb6d8eea6210b9983335a87a4ea5d2 100644 (file)
@@ -133,7 +133,7 @@ ifeq ($(strip $(LED_MATRIX_ENABLE)), IS31FL3731)
     OPT_DEFS += -DIS31FL3731
     COMMON_VPATH += $(DRIVER_PATH)/issi
     SRC += is31fl3731-simple.c
-    SRC += i2c_master.c
+    QUANTUM_LIB_SRC += i2c_master.c
 endif
 
 RGB_MATRIX_ENABLE ?= no
@@ -157,21 +157,21 @@ ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3731)
     OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE
     COMMON_VPATH += $(DRIVER_PATH)/issi
     SRC += is31fl3731.c
-    SRC += i2c_master.c
+    QUANTUM_LIB_SRC += i2c_master.c
 endif
 
 ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3733)
     OPT_DEFS += -DIS31FL3733 -DSTM32_I2C -DHAL_USE_I2C=TRUE
     COMMON_VPATH += $(DRIVER_PATH)/issi
     SRC += is31fl3733.c
-    SRC += i2c_master.c
+    QUANTUM_LIB_SRC += i2c_master.c
 endif
 
 ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3737)
     OPT_DEFS += -DIS31FL3737 -DSTM32_I2C -DHAL_USE_I2C=TRUE
     COMMON_VPATH += $(DRIVER_PATH)/issi
     SRC += is31fl3737.c
-    SRC += i2c_master.c
+    QUANTUM_LIB_SRC += i2c_master.c
 endif
 
 ifeq ($(strip $(RGB_MATRIX_ENABLE)), WS2812)
@@ -271,7 +271,7 @@ ifeq ($(strip $(HAPTIC_ENABLE)), DRV2605L)
     COMMON_VPATH += $(DRIVER_PATH)/haptic
     SRC += haptic.c
     SRC += DRV2605L.c
-    SRC += i2c_master.c
+    QUANTUM_LIB_SRC += i2c_master.c
     OPT_DEFS += -DHAPTIC_ENABLE
     OPT_DEFS += -DDRV2605L
 endif
index 4ae2d78e3e7b888348f71a8323ca82beaa5645ea..b23c25657de281048697493abe4646b5e8138793 100644 (file)
@@ -2,9 +2,7 @@ ifneq ($(strip $(QWIIC_ENABLE)),)
   COMMON_VPATH += $(DRIVER_PATH)/qwiic
   OPT_DEFS += -DQWIIC_ENABLE
   SRC += qwiic.c
-  ifeq ($(filter "i2c_master.c", $(SRC)),)
-    SRC += i2c_master.c
-  endif
+  QUANTUM_LIB_SRC += i2c_master.c
 endif
 
 ifneq ($(filter JOYSTIIC, $(QWIIC_ENABLE)),)
index e96cd20825c3f530f4dbfba7df3b53a224beb112..2882072a627dea4398388d73322ad85172cdc6e8 100644 (file)
@@ -16,6 +16,7 @@
 
 # # project specific files
 SRC += matrix.c
+QUANTUM_LIB_SRC += i2c_master.c
 
 # MCU name
 MCU = atmega32u4
@@ -85,9 +86,4 @@ RGBLIGHT_ENABLE = yes
 RGB_MATRIX_ENABLE = no # enable later
 DEBOUNCE_TYPE = eager_pr
 
-ifeq ($(strip $(RGB_MATRIX_ENABLE)), no)
-  SRC += i2c_master.c
-endif
-
-
 LAYOUTS = ergodox
index 49ab981d148c22e2fb5c8a4c168468963a05f0c5..4345027f41783b4d3f1888a328c1beb45e1e6044 100644 (file)
@@ -1,5 +1,5 @@
-SRC += i2c_master.c \
-          leds.c \
+QUANTUM_LIB_SRC += i2c_master.c
+SRC += leds.c \
           matrix.c
 
 # MCU name