aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Mussared2020-01-15 14:15:08 +1100
committerDamien George2020-03-11 15:34:10 +1100
commit211032a5c9a2807bc596c95bac575082badf730d (patch)
treed7fcff9bc1ed215299b1acaa857fcf6e3ddf2e34
parent6cea369b89b2223cf07ff8768e50dc39bbb770fe (diff)
samd: Fix to build with latest tinyusb.
-rw-r--r--ports/samd/Makefile3
-rw-r--r--ports/samd/tusb_port.c4
2 files changed, 3 insertions, 4 deletions
diff --git a/ports/samd/Makefile b/ports/samd/Makefile
index 23646a484..2a5c2905c 100644
--- a/ports/samd/Makefile
+++ b/ports/samd/Makefile
@@ -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
diff --git a/ports/samd/tusb_port.c b/ports/samd/tusb_port.c
index 8f18e5e08..d1d9e0d8c 100644
--- a/ports/samd/tusb_port.c
+++ b/ports/samd/tusb_port.c
@@ -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;
}