mirror of
https://github.com/polhenarejos/pico-keys-sdk
synced 2026-05-28 09:01:24 +02:00
Fix interface strings when are not all enabled.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -316,6 +316,7 @@ uint8_t const *tud_descriptor_bos_cb(void) {
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// array of pointer to string descriptors
|
||||
char *string_desc_itf[4] = {0};
|
||||
char const *string_desc_arr [] = {
|
||||
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
|
||||
"Pol Henarejos", // 1: Manufacturer
|
||||
@@ -369,6 +370,9 @@ uint16_t const *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
|
||||
str = phy_data.usb_product;
|
||||
}
|
||||
}
|
||||
else if (index >= 5 && string_desc_itf[index - 5] != NULL) {
|
||||
str = string_desc_itf[index - 5];
|
||||
}
|
||||
|
||||
uint8_t buff_avail = sizeof(_desc_str) / sizeof(_desc_str[0]) - 1;
|
||||
if (index >= 4) {
|
||||
|
||||
Reference in New Issue
Block a user