Skip to content

Commit 6cbdb64

Browse files
committed
Fix builds without custom USB ID
1 parent 28b7421 commit 6cbdb64

File tree

1 file changed

+12
-8
lines changed
  • supervisor/shared/usb

1 file changed

+12
-8
lines changed

supervisor/shared/usb/usb.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,21 @@ void usb_init(void) {
7171
#if CIRCUITPY_USB_DEVICE
7272
usb_identification_t defaults;
7373
usb_identification_t *identification;
74+
#if CIRCUITPY_USB_IDENTIFICATION
7475
if (custom_usb_identification != NULL) {
7576
identification = custom_usb_identification;
7677
} else {
77-
// This compiles to less code than using a struct initializer.
78-
defaults.vid = USB_VID;
79-
defaults.pid = USB_PID;
80-
strcpy(defaults.manufacturer_name, USB_MANUFACTURER);
81-
strcpy(defaults.product_name, USB_PRODUCT);
82-
identification = &defaults;
83-
// This memory only needs to be live through the end of usb_build_descriptors.
84-
}
78+
#endif
79+
// This compiles to less code than using a struct initializer.
80+
defaults.vid = USB_VID;
81+
defaults.pid = USB_PID;
82+
strcpy(defaults.manufacturer_name, USB_MANUFACTURER);
83+
strcpy(defaults.product_name, USB_PRODUCT);
84+
identification = &defaults;
85+
// This memory only needs to be live through the end of usb_build_descriptors.
86+
#if CIRCUITPY_USB_IDENTIFICATION
87+
}
88+
#endif
8589
if (!usb_build_descriptors(identification)) {
8690
return;
8791
}

0 commit comments

Comments
 (0)