From 35924e727d391c1291d19154a24c4613e5f75385 Mon Sep 17 00:00:00 2001 From: Tomas Rezucha Date: Thu, 25 Jan 2024 12:46:25 +0100 Subject: [PATCH] feature(usb_host_msc): Add support for ESP32-P4 --- host/class/msc/usb_host_msc/CHANGELOG.md | 3 ++- host/class/msc/usb_host_msc/idf_component.yml | 2 +- host/class/msc/usb_host_msc/src/msc_host.c | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/host/class/msc/usb_host_msc/CHANGELOG.md b/host/class/msc/usb_host_msc/CHANGELOG.md index 2a42362a..8d9b2b34 100644 --- a/host/class/msc/usb_host_msc/CHANGELOG.md +++ b/host/class/msc/usb_host_msc/CHANGELOG.md @@ -1,5 +1,6 @@ -## 1.1.2 Unreleased +## 1.1.2 +- Added support for ESP32-P4 - Reverted zero-copy bulk transfers. Data are now copied to USB buffers with negligible effect on performance ## 1.1.1 diff --git a/host/class/msc/usb_host_msc/idf_component.yml b/host/class/msc/usb_host_msc/idf_component.yml index 8da50962..e42885c7 100644 --- a/host/class/msc/usb_host_msc/idf_component.yml +++ b/host/class/msc/usb_host_msc/idf_component.yml @@ -1,5 +1,5 @@ ## IDF Component Manager Manifest File -version: "1.1.1~1" +version: "1.1.2" description: USB Host MSC driver url: https://github.com/espressif/esp-usb/tree/master/host/class/msc/usb_host_msc dependencies: diff --git a/host/class/msc/usb_host_msc/src/msc_host.c b/host/class/msc/usb_host_msc/src/msc_host.c index 772915da..441c1272 100644 --- a/host/class/msc/usb_host_msc/src/msc_host.c +++ b/host/class/msc/usb_host_msc/src/msc_host.c @@ -543,7 +543,10 @@ static void copy_string_desc(wchar_t *dest, const usb_str_desc_t *src) } if (src != NULL) { size_t len = MIN((src->bLength - USB_STANDARD_DESC_SIZE) / 2, MSC_STR_DESC_SIZE - 1); - wcsncpy(dest, src->wData, len); + for (int i = 0; i < len; i++) { + // Convert UTF-16 to wchar_t + dest[i] = src->wData[i]; + } if (dest != NULL) { // This should be always true, we just check to avoid LoadProhibited exception dest[len] = 0; }