-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13382 from chrysn-pull-requests/usb-check-unifica…
…tion usb: Warn on test-ID usage in a unified location
- Loading branch information
Showing
10 changed files
with
63 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This file contains all codes that should trigger the usb_id_check warning | ||
# about a test PID being used | ||
|
||
1209 0001 | ||
1209 0002 | ||
1209 0003 | ||
1209 0004 | ||
1209 0005 | ||
1209 0006 | ||
1209 0007 | ||
1209 0008 | ||
1209 0009 | ||
1209 000a | ||
1209 000b | ||
1209 000c | ||
1209 000d | ||
1209 000e | ||
1209 000f | ||
1209 0010 | ||
1209 7d01 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# 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 | ||
USB_VID_TESTING = 1209 | ||
USB_PID_TESTING = 7D01 | ||
usb_id_check: | ||
@if grep --quiet --ignore-case "^$(USB_VID) $(USB_PID)$$" $(RIOTBASE)/dist/usb_id_testing; then \ | ||
$(COLOR_ECHO) "$(COLOR_RED)Private testing pid.codes USB VID/PID used!, do not use it outside of test environments!$(COLOR_RESET)" 1>&2 ; \ | ||
$(COLOR_ECHO) "$(COLOR_RED)MUST NOT be used on any device redistributed, sold or manufactured, VID/PID is not unique!$(COLOR_RESET)" 1>&2 ; \ | ||
fi | ||
@if [ "$(USB_VID) $(subst D,d,$(USB_PID))" = "1209 7d00" ]; then \ | ||
$(COLOR_ECHO) "$(COLOR_RED)RIOT standard peripherals code (1209/7D00) cannot be set explicitly.$(COLOR_RESET)" 1>&2 ; \ | ||
$(COLOR_ECHO) "$(COLOR_RED)Unset USB_VID / USB_PID for the code to be picked automatically, or set$(COLOR_RESET)" 1>&2 ; \ | ||
$(COLOR_ECHO) "$(COLOR_RED)them to \$${USB_VID_TESTING} / \$${USB_PID_TESTING} during development.$(COLOR_RESET)" 1>&2 ; \ | ||
exit 1; \ | ||
fi | ||
.PHONY: usb_id_check | ||
all: | usb_id_check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters