forked from PAWPAW-Mirror/lib_xua
Merge pull request #303 from danielpieczko/no_usb_chans_in
Avoid calling SetupZerosSendBuffer when there are no IN eps
This commit is contained in:
@@ -1,6 +1,11 @@
|
|||||||
lib_xua Change Log
|
lib_xua Change Log
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
UNRELEASED
|
||||||
|
----------
|
||||||
|
|
||||||
|
* FIXED: Exception on startup when USB input disabled
|
||||||
|
|
||||||
3.3.1
|
3.3.1
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|||||||
@@ -588,6 +588,7 @@ __builtin_unreachable();
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (NUM_USB_CHAN_IN > 0)
|
||||||
/* Mark Endpoint (IN) ready with an appropriately sized zero buffer */
|
/* 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,
|
static inline void SetupZerosSendBuffer(XUD_ep aud_to_host_usb_ep, unsigned sampFreq, unsigned slotSize,
|
||||||
xc_ptr aud_to_host_zeros)
|
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);
|
XUD_SetReady_InPtr(aud_to_host_usb_ep, aud_to_host_zeros+4, mid);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#pragma unsafe arrays
|
#pragma unsafe arrays
|
||||||
void XUA_Buffer_Decouple(chanend c_mix_out
|
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 */
|
/* Set buffer to send back to zeros buffer */
|
||||||
aud_to_host_buffer = aud_to_host_zeros;
|
aud_to_host_buffer = aud_to_host_zeros;
|
||||||
|
|
||||||
|
#if (NUM_USB_CHAN_IN > 0)
|
||||||
/* Update size of zeros buffer (and sampsToWrite) */
|
/* Update size of zeros buffer (and sampsToWrite) */
|
||||||
SetupZerosSendBuffer(aud_to_host_usb_ep, sampFreq, g_curSubSlot_In, aud_to_host_zeros);
|
SetupZerosSendBuffer(aud_to_host_usb_ep, sampFreq, g_curSubSlot_In, aud_to_host_zeros);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Reset OUT buffer state */
|
/* Reset OUT buffer state */
|
||||||
outUnderflow = 1;
|
outUnderflow = 1;
|
||||||
@@ -815,8 +819,10 @@ void XUA_Buffer_Decouple(chanend c_mix_out
|
|||||||
/* Set buffer back to zeros buffer */
|
/* Set buffer back to zeros buffer */
|
||||||
aud_to_host_buffer = aud_to_host_zeros;
|
aud_to_host_buffer = aud_to_host_zeros;
|
||||||
|
|
||||||
|
#if (NUM_USB_CHAN_IN > 0)
|
||||||
/* Update size of zeros buffer (and sampsToWrite) */
|
/* Update size of zeros buffer (and sampsToWrite) */
|
||||||
SetupZerosSendBuffer(aud_to_host_usb_ep, sampFreq, g_curSubSlot_In, aud_to_host_zeros);
|
SetupZerosSendBuffer(aud_to_host_usb_ep, sampFreq, g_curSubSlot_In, aud_to_host_zeros);
|
||||||
|
#endif
|
||||||
|
|
||||||
GET_SHARED_GLOBAL(usbSpeed, g_curUsbSpeed);
|
GET_SHARED_GLOBAL(usbSpeed, g_curUsbSpeed);
|
||||||
if (usbSpeed == XUD_SPEED_HS)
|
if (usbSpeed == XUD_SPEED_HS)
|
||||||
|
|||||||
Reference in New Issue
Block a user