From b35df81a03ed4248680bc5f2099d4fd97e71baf8 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Sat, 29 Aug 2026 21:08:34 +0200 Subject: [PATCH] Fix esp build for non-hid Signed-off-by: Pol Henarejos --- config/esp32/components/pico-keys-sdk/CMakeLists.txt | 6 +++++- src/usb/ccid/ccid.c | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config/esp32/components/pico-keys-sdk/CMakeLists.txt b/config/esp32/components/pico-keys-sdk/CMakeLists.txt index 1eab692..c39bd04 100755 --- a/config/esp32/components/pico-keys-sdk/CMakeLists.txt +++ b/config/esp32/components/pico-keys-sdk/CMakeLists.txt @@ -15,8 +15,12 @@ set(PICOKEYS_REQUIRES esp_tinyusb efuse mbedtls - tinycbor ) +if(USB_ITF_HID) + list(APPEND PICOKEYS_REQUIRES + tinycbor + ) +endif() if (USB_ITF_LWIP) list(APPEND PICOKEYS_REQUIRES diff --git a/src/usb/ccid/ccid.c b/src/usb/ccid/ccid.c index be0d625..b9846e2 100644 --- a/src/usb/ccid/ccid.c +++ b/src/usb/ccid/ccid.c @@ -415,8 +415,10 @@ static uint16_t ccid_open(uint8_t rhport, tusb_desc_interface_t const *itf_desc, tusb_desc_endpoint_t const *desc_ep = (tusb_desc_endpoint_t const *)((uint8_t *)itf_desc + drv_len - sizeof(tusb_desc_endpoint_t)); TU_ASSERT(usbd_edpt_open(rhport, desc_ep), 0); uint8_t msg[] = { 0x50, 0x03 }; -#if defined(PICO_PLATFORM) || defined(ESP_PLATFORM) +#if defined(PICO_PLATFORM) usbd_edpt_xfer(rhport, desc_ep->bEndpointAddress, msg, sizeof(msg)); +#elif defined(ESP_PLATFORM) + usbd_edpt_xfer(rhport, desc_ep->bEndpointAddress, msg, sizeof(msg), false); #else usbd_edpt_xfer(rhport, desc_ep->bEndpointAddress, msg, sizeof(msg), sizeof(msg)); #endif