From 3e0a9bc47e2bee06a64a0bd183da01a1f0554f93 Mon Sep 17 00:00:00 2001 From: Stacey Sheldon Date: Sat, 19 May 2012 16:12:34 -0400 Subject: [PATCH] usb: Change supported LANGID in USB descriptor to be English US Some versions of Windows will ignore the USB device serial number if the string is not delivered with LANGID = English US 0x0409. This is true regardless of the configured locale of the machine. --- flight/Bootloaders/CopterControl/pios_usb_board_data.c | 2 +- flight/Bootloaders/PipXtreme/pios_usb_board_data.c | 2 +- flight/CopterControl/System/pios_usb_board_data.c | 2 +- flight/PiOS/inc/pios_usb_defs.h | 2 +- flight/PipXtreme/pios_usb_board_data.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flight/Bootloaders/CopterControl/pios_usb_board_data.c b/flight/Bootloaders/CopterControl/pios_usb_board_data.c index 7e8e73730..d112cb445 100644 --- a/flight/Bootloaders/CopterControl/pios_usb_board_data.c +++ b/flight/Bootloaders/CopterControl/pios_usb_board_data.c @@ -59,7 +59,7 @@ static uint8_t usb_serial_number[2 + PIOS_SYS_SERIAL_NUM_ASCII_LEN*2 + 3*2] = { static const struct usb_string_langid usb_lang_id = { .bLength = sizeof(usb_lang_id), .bDescriptorType = USB_DESC_TYPE_STRING, - .bLangID = htousbs(USB_LANGID_ENGLISH_UK), + .bLangID = htousbs(USB_LANGID_ENGLISH_US), }; static const uint8_t usb_vendor_id[28] = { diff --git a/flight/Bootloaders/PipXtreme/pios_usb_board_data.c b/flight/Bootloaders/PipXtreme/pios_usb_board_data.c index 3e41e5ac9..f9a32e386 100644 --- a/flight/Bootloaders/PipXtreme/pios_usb_board_data.c +++ b/flight/Bootloaders/PipXtreme/pios_usb_board_data.c @@ -79,7 +79,7 @@ static uint8_t usb_serial_number[52] = { static const struct usb_string_langid usb_lang_id = { .bLength = sizeof(usb_lang_id), .bDescriptorType = USB_DESC_TYPE_STRING, - .bLangID = htousbs(USB_LANGID_ENGLISH_UK), + .bLangID = htousbs(USB_LANGID_ENGLISH_US), }; static const uint8_t usb_vendor_id[28] = { diff --git a/flight/CopterControl/System/pios_usb_board_data.c b/flight/CopterControl/System/pios_usb_board_data.c index 7e8e73730..d112cb445 100644 --- a/flight/CopterControl/System/pios_usb_board_data.c +++ b/flight/CopterControl/System/pios_usb_board_data.c @@ -59,7 +59,7 @@ static uint8_t usb_serial_number[2 + PIOS_SYS_SERIAL_NUM_ASCII_LEN*2 + 3*2] = { static const struct usb_string_langid usb_lang_id = { .bLength = sizeof(usb_lang_id), .bDescriptorType = USB_DESC_TYPE_STRING, - .bLangID = htousbs(USB_LANGID_ENGLISH_UK), + .bLangID = htousbs(USB_LANGID_ENGLISH_US), }; static const uint8_t usb_vendor_id[28] = { diff --git a/flight/PiOS/inc/pios_usb_defs.h b/flight/PiOS/inc/pios_usb_defs.h index f0352333f..be827a494 100644 --- a/flight/PiOS/inc/pios_usb_defs.h +++ b/flight/PiOS/inc/pios_usb_defs.h @@ -300,7 +300,7 @@ struct usb_cdc_union_func_desc { uint8_t bSlaveInterface; } __attribute__((packed)); -#define USB_LANGID_ENGLISH_UK 0x0809 +#define USB_LANGID_ENGLISH_US 0x0409 struct usb_string_langid { uint8_t bLength; diff --git a/flight/PipXtreme/pios_usb_board_data.c b/flight/PipXtreme/pios_usb_board_data.c index 3e41e5ac9..f9a32e386 100644 --- a/flight/PipXtreme/pios_usb_board_data.c +++ b/flight/PipXtreme/pios_usb_board_data.c @@ -79,7 +79,7 @@ static uint8_t usb_serial_number[52] = { static const struct usb_string_langid usb_lang_id = { .bLength = sizeof(usb_lang_id), .bDescriptorType = USB_DESC_TYPE_STRING, - .bLangID = htousbs(USB_LANGID_ENGLISH_UK), + .bLangID = htousbs(USB_LANGID_ENGLISH_US), }; static const uint8_t usb_vendor_id[28] = {