Skip to content

Commit

Permalink
Fix manufacturer & product string descriptors linker errors after C++…
Browse files Browse the repository at this point in the history
… migration.
  • Loading branch information
forderud committed Oct 7, 2024
1 parent d9a818e commit 7f58b6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions teensy4/usb_desc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2719,9 +2719,9 @@ struct usb_string_descriptor_struct {
};
*/

extern struct usb_string_descriptor_struct usb_string_manufacturer_name
extern const struct usb_string_descriptor_struct usb_string_manufacturer_name
__attribute__ ((weak, alias("usb_string_manufacturer_name_default")));
extern struct usb_string_descriptor_struct usb_string_product_name
extern const struct usb_string_descriptor_struct usb_string_product_name
__attribute__ ((weak, alias("usb_string_product_name_default")));
extern struct usb_string_descriptor_struct usb_string_serial_number
__attribute__ ((weak, alias("usb_string_serial_number_default")));
Expand All @@ -2732,12 +2732,12 @@ PROGMEM const struct usb_string_descriptor_struct string0 = {
{0x0409}
};

PROGMEM const struct usb_string_descriptor_struct usb_string_manufacturer_name_default = {
extern "C" PROGMEM const struct usb_string_descriptor_struct usb_string_manufacturer_name_default = {
2 + MANUFACTURER_NAME_LEN * 2,
3,
MANUFACTURER_NAME
};
PROGMEM const struct usb_string_descriptor_struct usb_string_product_name_default = {
extern "C" PROGMEM const struct usb_string_descriptor_struct usb_string_product_name_default = {
2 + PRODUCT_NAME_LEN * 2,
3,
PRODUCT_NAME
Expand Down
4 changes: 2 additions & 2 deletions teensy4/usb_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ struct usb_string_descriptor_struct {
uint16_t wString[];
};

extern struct usb_string_descriptor_struct usb_string_manufacturer_name;
extern struct usb_string_descriptor_struct usb_string_product_name;
extern const struct usb_string_descriptor_struct usb_string_manufacturer_name;
extern const struct usb_string_descriptor_struct usb_string_product_name;
extern struct usb_string_descriptor_struct usb_string_serial_number;

#ifdef __cplusplus
Expand Down

0 comments on commit 7f58b6a

Please sign in to comment.