Skip to content

Commit

Permalink
Allow overriding USB_MANUFACTURER from Kconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
vvuk committed Feb 17, 2025
1 parent 01edde4 commit db493be
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ config USB_SERIAL_NUMBER_CHIPID
default y
config USB_SERIAL_NUMBER
default "12345"
config USB_MANUFACTURER
default "Klipper"

menu "USB ids"
depends on USB && LOW_LEVEL_OPTIONS
Expand All @@ -87,6 +89,8 @@ config USB_SERIAL_NUMBER_CHIPID
bool "USB serial number from CHIPID" if HAVE_CHIPID
config USB_SERIAL_NUMBER
string "USB serial number" if !USB_SERIAL_NUMBER_CHIPID
config USB_MANUFACTURER
string "USB manufacturer"
endmenu

menu "CAN bus UUID"
Expand Down
4 changes: 4 additions & 0 deletions src/generic/usb_canbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,11 @@ usb_notify_bulk_in(void)

#define CONCAT1(a, b) a ## b
#define CONCAT(a, b) CONCAT1(a, b)
#if defined(CONFIG_USB_MANUFACTURER)
#define USB_STR_MANUFACTURER u""CONFIG_USB_MANUFACTURER
#else
#define USB_STR_MANUFACTURER u"Klipper"
#endif
#define USB_STR_PRODUCT CONCAT(u,CONFIG_MCU)
#define USB_STR_SERIAL CONCAT(u,CONFIG_USB_SERIAL_NUMBER)

Expand Down
4 changes: 4 additions & 0 deletions src/generic/usb_cdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ DECL_TASK(usb_bulk_out_task);

#define CONCAT1(a, b) a ## b
#define CONCAT(a, b) CONCAT1(a, b)
#if defined(CONFIG_USB_MANUFACTURER)
#define USB_STR_MANUFACTURER u""CONFIG_USB_MANUFACTURER
#else
#define USB_STR_MANUFACTURER u"Klipper"
#endif
#define USB_STR_PRODUCT CONCAT(u,CONFIG_MCU)
#define USB_STR_SERIAL CONCAT(u,CONFIG_USB_SERIAL_NUMBER)

Expand Down

0 comments on commit db493be

Please sign in to comment.