diff --git a/sys/include/usb.h b/sys/include/usb.h index 69d895a214..9eb4c1265b 100644 --- a/sys/include/usb.h +++ b/sys/include/usb.h @@ -17,20 +17,6 @@ * @author Koen Zandberg */ -/* These checks are deliberately outside the include guards, as they depend on - * a define that only RIOT-internal users set */ - -#if !(defined(CONFIG_USB_VID) && defined(CONFIG_USB_PID)) -#ifdef USB_H_USER_IS_RIOT_INTERNAL -/* Reserved for RIOT standard peripherals as per http://pid.codes/1209/7D00/ */ -#define CONFIG_USB_VID (0x1209) -#define CONFIG_USB_PID (0x7D00) -#else -#error Please configure your vendor and product IDs. For development, you may \ - set CONFIG_USB_VID=0x1209 CONFIG_USB_PID=0x7D01. -#endif -#endif - #ifndef USB_H #define USB_H @@ -43,6 +29,18 @@ extern "C" { * @ingroup config * @{ */ + +#if !(defined(CONFIG_USB_VID) && defined(CONFIG_USB_PID)) +#ifdef USB_H_USER_IS_RIOT_INTERNAL +/* Reserved for RIOT standard peripherals as per http://pid.codes/1209/7D00/ */ +#define CONFIG_USB_VID (0x1209) +#define CONFIG_USB_PID (0x7D00) +#else +#error Please configure your vendor and product IDs. For development, you may \ + set CONFIG_USB_VID=0x1209 CONFIG_USB_PID=0x7D01. +#endif +#endif + /** * @brief USB peripheral device vendor ID * @@ -132,8 +130,10 @@ extern "C" { /** * @brief RIOT-internal USB peripheral clearance indicator * - * This define must only be set by RIOT internal users of `usb.h`, and only when - * they implement peripherals that can be considered default RIOT peripherals. + * This define must only be set in compilation units that are RIOT internal, + * and only when they implement peripherals that can be considered default RIOT + * peripherals. + * * When this is defined in all uses of `usb.h`, the board can use the * 0x1209/0x7D00 VID/PID pair unless explicit configuration using @ref * CONFIG_USB_VID and @ref CONFIG_USB_PID say otherwise.