forked from PAWPAW-Mirror/lib_xua
Merge pull request #175 from xmos/QuinnWang-patch-1
decouple update for DFU "fake" SET_SAMPLE_FREQ special processing
This commit is contained in:
@@ -747,29 +747,32 @@ void XUA_Buffer_Decouple(chanend c_mix_out
|
|||||||
inuint(c_mix_out);
|
inuint(c_mix_out);
|
||||||
outct(c_mix_out, SET_SAMPLE_FREQ);
|
outct(c_mix_out, SET_SAMPLE_FREQ);
|
||||||
outuint(c_mix_out, sampFreq);
|
outuint(c_mix_out, sampFreq);
|
||||||
|
|
||||||
inUnderflow = 1;
|
if(sampFreq != AUDIO_STOP_FOR_DFU)
|
||||||
SET_SHARED_GLOBAL(g_aud_to_host_rdptr, aud_to_host_fifo_start);
|
|
||||||
SET_SHARED_GLOBAL(g_aud_to_host_wrptr, aud_to_host_fifo_start);
|
|
||||||
SET_SHARED_GLOBAL(g_aud_to_host_dptr,aud_to_host_fifo_start+4);
|
|
||||||
|
|
||||||
/* Set buffer to send back to zeros buffer */
|
|
||||||
SET_SHARED_GLOBAL(g_aud_to_host_buffer, g_aud_to_host_zeros);
|
|
||||||
|
|
||||||
/* Update size of zeros buffer (and sampsToWrite) */
|
|
||||||
SetupZerosSendBuffer(aud_to_host_usb_ep, sampFreq, g_curSubSlot_In);
|
|
||||||
|
|
||||||
/* Reset OUT buffer state */
|
|
||||||
outUnderflow = 1;
|
|
||||||
SET_SHARED_GLOBAL(g_aud_from_host_rdptr, aud_from_host_fifo_start);
|
|
||||||
SET_SHARED_GLOBAL(g_aud_from_host_wrptr, aud_from_host_fifo_start);
|
|
||||||
SET_SHARED_GLOBAL(aud_data_remaining_to_device, 0);
|
|
||||||
|
|
||||||
if(outOverflow)
|
|
||||||
{
|
{
|
||||||
/* If we were previously in overflow we wont have marked as ready */
|
inUnderflow = 1;
|
||||||
XUD_SetReady_OutPtr(aud_from_host_usb_ep, aud_from_host_fifo_start+4);
|
SET_SHARED_GLOBAL(g_aud_to_host_rdptr, aud_to_host_fifo_start);
|
||||||
outOverflow = 0;
|
SET_SHARED_GLOBAL(g_aud_to_host_wrptr, aud_to_host_fifo_start);
|
||||||
|
SET_SHARED_GLOBAL(g_aud_to_host_dptr,aud_to_host_fifo_start+4);
|
||||||
|
|
||||||
|
/* Set buffer to send back to zeros buffer */
|
||||||
|
SET_SHARED_GLOBAL(g_aud_to_host_buffer, g_aud_to_host_zeros);
|
||||||
|
|
||||||
|
/* Update size of zeros buffer (and sampsToWrite) */
|
||||||
|
SetupZerosSendBuffer(aud_to_host_usb_ep, sampFreq, g_curSubSlot_In);
|
||||||
|
|
||||||
|
/* Reset OUT buffer state */
|
||||||
|
outUnderflow = 1;
|
||||||
|
SET_SHARED_GLOBAL(g_aud_from_host_rdptr, aud_from_host_fifo_start);
|
||||||
|
SET_SHARED_GLOBAL(g_aud_from_host_wrptr, aud_from_host_fifo_start);
|
||||||
|
SET_SHARED_GLOBAL(aud_data_remaining_to_device, 0);
|
||||||
|
|
||||||
|
if(outOverflow)
|
||||||
|
{
|
||||||
|
/* If we were previously in overflow we wont have marked as ready */
|
||||||
|
XUD_SetReady_OutPtr(aud_from_host_usb_ep, aud_from_host_fifo_start+4);
|
||||||
|
outOverflow = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wait for handshake back and pass back up */
|
/* Wait for handshake back and pass back up */
|
||||||
@@ -780,7 +783,8 @@ void XUA_Buffer_Decouple(chanend c_mix_out
|
|||||||
|
|
||||||
ENABLE_INTERRUPTS();
|
ENABLE_INTERRUPTS();
|
||||||
|
|
||||||
speedRem = 0;
|
if(sampFreq != AUDIO_STOP_FOR_DFU)
|
||||||
|
speedRem = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#if (AUDIO_CLASS == 2)
|
#if (AUDIO_CLASS == 2)
|
||||||
|
|||||||
Reference in New Issue
Block a user