samd: Fix to build with latest tinyusb.

This commit is contained in:
Jim Mussared 2020-01-15 14:15:08 +11:00 committed by Damien George
parent 6cea369b89
commit 211032a5c9
2 changed files with 3 additions and 4 deletions

View File

@ -63,16 +63,15 @@ SRC_C = \
lib/tinyusb/src/common/tusb_fifo.c \
lib/tinyusb/src/device/usbd.c \
lib/tinyusb/src/device/usbd_control.c \
lib/tinyusb/src/portable/microchip/samd/dcd_samd.c \
lib/tinyusb/src/tusb.c \
lib/utils/printf.c \
lib/utils/pyexec.c \
lib/utils/stdout_helpers.c \
ifeq ($(MCU_SERIES),SAMD21)
SRC_C += lib/tinyusb/src/portable/microchip/samd21/dcd_samd21.c
SRC_S = lib/utils/gchelper_m0.s
else
SRC_C += lib/tinyusb/src/portable/microchip/samd51/dcd_samd51.c
SRC_S = lib/utils/gchelper_m3.s
endif

View File

@ -108,8 +108,8 @@ const uint16_t *tud_descriptor_string_cb(uint8_t index) {
}
}
// first byte is len, second byte is string type
desc_str[0] = TUD_DESC_STR_HEADER(len);
// first byte is length (including header), second byte is string type
desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2 * len + 2);
return desc_str;
}