mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
usb: Move Kconfig/Makefile merging into main Makefile.include
This allows the check for test IDs to run independently of the configuration source, and provides a canonical point for the configurable (and tested) Makefile variable to enter CFLAGS.
This commit is contained in:
parent
250f6fdfa3
commit
346093c290
@ -662,6 +662,23 @@ endif
|
||||
@$(COLOR_ECHO) '$(COLOR_GREEN)Building application "$(APPLICATION)" for "$(BOARD)" with MCU "$(MCU)".$(COLOR_RESET)'
|
||||
@$(COLOR_ECHO)
|
||||
|
||||
# Set USB VID/PID via CFLAGS if not being set via Kconfig
|
||||
ifndef CONFIG_USB_VID
|
||||
ifdef USB_VID
|
||||
CFLAGS += -DCONFIG_USB_VID=0x$(USB_VID)
|
||||
endif
|
||||
else
|
||||
USB_VID = $(patsubst 0x%,%,$(CONFIG_USB_VID))
|
||||
endif
|
||||
|
||||
ifndef CONFIG_USB_PID
|
||||
ifdef USB_PID
|
||||
CFLAGS += -DCONFIG_USB_PID=0x$(USB_PID)
|
||||
endif
|
||||
else
|
||||
USB_PID = $(patsubst 0x%,%,$(CONFIG_USB_PID))
|
||||
endif
|
||||
|
||||
# Exported for the benefit of Kconfig
|
||||
export USB_VID_TESTING = 1209
|
||||
export USB_PID_TESTING = 7D01
|
||||
|
@ -26,16 +26,3 @@ QUIET ?= 1
|
||||
SHOULD_RUN_KCONFIG ?=
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
||||
|
||||
# Set USB VID/PID via CFLAGS if not being set via Kconfig
|
||||
ifndef CONFIG_USB_VID
|
||||
CFLAGS += -DCONFIG_USB_VID=0x$(USB_VID)
|
||||
else
|
||||
USB_VID = $(patsubst 0x%,%,$(CONFIG_USB_VID))
|
||||
endif
|
||||
|
||||
ifndef CONFIG_USB_PID
|
||||
CFLAGS += -DCONFIG_USB_PID=0x$(USB_PID)
|
||||
else
|
||||
USB_PID = $(patsubst 0x%,%,$(CONFIG_USB_PID))
|
||||
endif
|
||||
|
@ -9,6 +9,4 @@ DISABLE_MODULE += auto_init_usbus
|
||||
USB_VID ?= $(USB_VID_TESTING)
|
||||
USB_PID ?= $(USB_PID_TESTING)
|
||||
|
||||
CFLAGS += -DCONFIG_USB_VID=0x$(USB_VID) -DCONFIG_USB_PID=0x$(USB_PID)
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
||||
|
Loading…
Reference in New Issue
Block a user