From 9c460f753f4d566f90a6bca4b4537b0fc7d2a70c Mon Sep 17 00:00:00 2001 From: Daniel Pieczko Date: Thu, 10 Nov 2022 16:43:43 +0000 Subject: [PATCH] Avoid calling SetupZerosSendBuffer when there are no IN eps --- lib_xua/src/core/buffer/decouple/decouple.xc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib_xua/src/core/buffer/decouple/decouple.xc b/lib_xua/src/core/buffer/decouple/decouple.xc index 2e64ecd0..ac27864a 100644 --- a/lib_xua/src/core/buffer/decouple/decouple.xc +++ b/lib_xua/src/core/buffer/decouple/decouple.xc @@ -588,6 +588,7 @@ __builtin_unreachable(); } } +#if (NUM_USB_CHAN_IN > 0) /* Mark Endpoint (IN) ready with an appropriately sized zero buffer */ static inline void SetupZerosSendBuffer(XUD_ep aud_to_host_usb_ep, unsigned sampFreq, unsigned slotSize, xc_ptr aud_to_host_zeros) @@ -619,6 +620,7 @@ static inline void SetupZerosSendBuffer(XUD_ep aud_to_host_usb_ep, unsigned samp XUD_SetReady_InPtr(aud_to_host_usb_ep, aud_to_host_zeros+4, mid); } +#endif #pragma unsafe arrays void XUA_Buffer_Decouple(chanend c_mix_out @@ -760,8 +762,10 @@ void XUA_Buffer_Decouple(chanend c_mix_out /* Set buffer to send back to zeros buffer */ aud_to_host_buffer = aud_to_host_zeros; +#if (NUM_USB_CHAN_IN > 0) /* Update size of zeros buffer (and sampsToWrite) */ SetupZerosSendBuffer(aud_to_host_usb_ep, sampFreq, g_curSubSlot_In, aud_to_host_zeros); +#endif /* Reset OUT buffer state */ outUnderflow = 1; @@ -815,8 +819,10 @@ void XUA_Buffer_Decouple(chanend c_mix_out /* Set buffer back to zeros buffer */ aud_to_host_buffer = aud_to_host_zeros; +#if (NUM_USB_CHAN_IN > 0) /* Update size of zeros buffer (and sampsToWrite) */ SetupZerosSendBuffer(aud_to_host_usb_ep, sampFreq, g_curSubSlot_In, aud_to_host_zeros); +#endif GET_SHARED_GLOBAL(usbSpeed, g_curUsbSpeed); if (usbSpeed == XUD_SPEED_HS)