From 7a52b7dd8353b63d42be7274b0eb02866ccb5cdc Mon Sep 17 00:00:00 2001 From: Ed Date: Wed, 1 May 2024 09:50:39 +0100 Subject: [PATCH 1/3] Initial fix for wrong in EP count --- lib_xua/api/xua_conf_default.h | 2 ++ lib_xua/src/core/endpoint0/xua_endpoint0.c | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib_xua/api/xua_conf_default.h b/lib_xua/api/xua_conf_default.h index 053dff28..82be6dab 100644 --- a/lib_xua/api/xua_conf_default.h +++ b/lib_xua/api/xua_conf_default.h @@ -1273,7 +1273,9 @@ enum USBEndpointNumber_In #if (NUM_USB_CHAN_IN == 0) || defined (UAC_FORCE_FEEDBACK_EP) ENDPOINT_NUMBER_IN_FEEDBACK, #endif +#if (NUM_USB_CHAN_IN != 0) ENDPOINT_NUMBER_IN_AUDIO, +#endif #if (XUA_SPDIF_RX_EN) || (XUA_ADAT_RX_EN) ENDPOINT_NUMBER_IN_INTERRUPT, /* Audio interrupt/status EP */ #endif diff --git a/lib_xua/src/core/endpoint0/xua_endpoint0.c b/lib_xua/src/core/endpoint0/xua_endpoint0.c index c24dfefc..3d3c3be4 100755 --- a/lib_xua/src/core/endpoint0/xua_endpoint0.c +++ b/lib_xua/src/core/endpoint0/xua_endpoint0.c @@ -814,7 +814,14 @@ void XUA_Endpoint0_loop(XUD_Result_t result, USB_SetupPacket_t sp, chanend c_ep0 { unsigned epNum = sp.wIndex & 0xff; - if ((epNum == ENDPOINT_ADDRESS_OUT_AUDIO) || (epNum == ENDPOINT_ADDRESS_IN_AUDIO)) +// Ensure we only check for AUDIO EPs if enabled +#if (NUM_USB_CHAN_IN != 0 && NUM_USB_CHAN_OUT == 0) + if (epNum == ENDPOINT_ADDRESS_IN_AUDIO) +#elif (NUM_USB_CHAN_IN == 0 && NUM_USB_CHAN_OUT != 0) + if (epNum == ENDPOINT_ADDRESS_OUT_AUDIO) +#elif (NUM_USB_CHAN_IN != 0 && NUM_USB_CHAN_OUT != 0) + if ((epNum == ENDPOINT_ADDRESS_IN_AUDIO) || (epNum == ENDPOINT_ADDRESS_OUT_AUDIO)) +#endif { #if (AUDIO_CLASS == 2) && (AUDIO_CLASS_FALLBACK) if(g_curUsbSpeed == XUD_SPEED_FS) From e1352e93d8292f311c55f0faa7993b5972d6b8c8 Mon Sep 17 00:00:00 2001 From: Ed Date: Wed, 1 May 2024 09:59:48 +0100 Subject: [PATCH 2/3] Copyright --- lib_xua/src/core/endpoint0/xua_endpoint0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_xua/src/core/endpoint0/xua_endpoint0.c b/lib_xua/src/core/endpoint0/xua_endpoint0.c index 3d3c3be4..6a656f95 100755 --- a/lib_xua/src/core/endpoint0/xua_endpoint0.c +++ b/lib_xua/src/core/endpoint0/xua_endpoint0.c @@ -1,4 +1,4 @@ -// Copyright 2011-2023 XMOS LIMITED. +// Copyright 2011-2024 XMOS LIMITED. // This Software is subject to the terms of the XMOS Public Licence: Version 1. /** * @brief Implements endpoint zero for an USB Audio 1.0/2.0 device From a73bb8217b45428355aa79f0bd22480f624731d1 Mon Sep 17 00:00:00 2001 From: Ed Date: Wed, 1 May 2024 11:42:43 +0100 Subject: [PATCH 3/3] Added changelog entry and for MIDI tests too (previous PR) --- CHANGELOG.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 70ee36c7..fe8994cb 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,6 +7,8 @@ UNRELEASED * FIXED: Device fails to enumerate when ADAT and S/PDIF transmit are enabled * CHANGED: Enable only the minimum number of ADAT input formats based for the supported sample frequencies + * FIXED: Incorrect internal input EP count for input only devices + * ADDED: MIDI unit and subsystem tests 4.0.0 -----