diff --git a/tests/usbus_cdc_ecm/Kconfig b/tests/usbus_cdc_ecm/Kconfig new file mode 100644 index 0000000000..a31bf18547 --- /dev/null +++ b/tests/usbus_cdc_ecm/Kconfig @@ -0,0 +1,5 @@ +config USB_VID + default 0x$(DEFAULT_VID) if KCONFIG_USB + +config USB_PID + default 0x$(DEFAULT_PID) if KCONFIG_USB diff --git a/tests/usbus_cdc_ecm/Makefile b/tests/usbus_cdc_ecm/Makefile index 2f5ab03d1e..346b8cb0c3 100644 --- a/tests/usbus_cdc_ecm/Makefile +++ b/tests/usbus_cdc_ecm/Makefile @@ -11,15 +11,29 @@ USEMODULE += ps # USB device vendor and product ID # pid.codes test VID/PID, not globally unique -DEFAULT_VID = 1209 -DEFAULT_PID = 7D00 +export DEFAULT_VID = 1209 +export DEFAULT_PID = 7D00 USB_VID ?= $(DEFAULT_VID) USB_PID ?= $(DEFAULT_PID) -CFLAGS += -DCONFIG_USB_VID=0x$(USB_VID) -DCONFIG_USB_PID=0x$(USB_PID) - 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 + +# There is a Kconfig in the app folder, we need to indicate not to run it by default +SHOULD_RUN_KCONFIG ?= + .PHONY: usb_id_check usb_id_check: @if [ $(USB_VID) = $(DEFAULT_VID) -o $(USB_PID) = $(DEFAULT_PID) ] ; then \