From be3b867ce0c2cd964cdcba7656f5d57ae255510d Mon Sep 17 00:00:00 2001 From: Fredrik Orderud Date: Sat, 21 Sep 2024 17:11:36 +0200 Subject: [PATCH] Stop hardcoding WinUSB descriptor string lengths Done to reduce risk of the descriptor lengths getting out of sync. --- teensy4/usb_desc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/teensy4/usb_desc.c b/teensy4/usb_desc.c index 010e3efb4..f7fbaabeb 100644 --- a/teensy4/usb_desc.c +++ b/teensy4/usb_desc.c @@ -2821,8 +2821,8 @@ const usb_descriptor_list_t usb_descriptor_list[] = { {0x0304, 0x0409, (const uint8_t *)&usb_string_mtp, 0}, #endif #ifdef EXPERIMENTAL_INTERFACE - {0x03EE, 0x0000, microsoft_os_string_desc, 18}, - {0x0000, 0xEE04, microsoft_os_compatible_id_desc, 40}, + {0x03EE, 0x0000, microsoft_os_string_desc, sizeof(microsoft_os_string_desc)}, + {0x0000, 0xEE04, microsoft_os_compatible_id_desc, sizeof(microsoft_os_compatible_id_desc)}, #endif {0x0300, 0x0000, (const uint8_t *)&string0, 0}, {0x0301, 0x0409, (const uint8_t *)&usb_string_manufacturer_name, 0},