forked from PAWPAW-Mirror/lib_xua
Attempted fix for bug #11031 (DFU command gets used as SF
This commit is contained in:
@@ -225,15 +225,7 @@ void buffer(register chanend c_aud_out, register chanend c_aud_in, chanend c_aud
|
|||||||
asm("ldaw %0, dp[g_midi_to_host_buffer_B]":"=r"(midi_to_host_waiting_buffer));
|
asm("ldaw %0, dp[g_midi_to_host_buffer_B]":"=r"(midi_to_host_waiting_buffer));
|
||||||
asm("ldaw %0, dp[g_midi_from_host_buffer]":"=r"(midi_from_host_buffer));
|
asm("ldaw %0, dp[g_midi_from_host_buffer]":"=r"(midi_from_host_buffer));
|
||||||
|
|
||||||
|
|
||||||
// pass the midi->XUD chanends to decouple so that thread can
|
|
||||||
// initialize comm with XUD
|
|
||||||
//asm("stw %0, dp[midi_to_host_usb_ep]"::"r"(ep_midi_to_host));
|
|
||||||
//asm("stw %0, dp[midi_from_host_usb_ep]"::"r"(ep_midi_from_host));
|
|
||||||
swap(midi_to_host_buffer, midi_to_host_waiting_buffer);
|
swap(midi_to_host_buffer, midi_to_host_waiting_buffer);
|
||||||
//SET_SHARED_GLOBAL(g_midi_from_host_flag, 1);
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef IAP
|
#ifdef IAP
|
||||||
@@ -321,12 +313,15 @@ void buffer(register chanend c_aud_out, register chanend c_aud_in, chanend c_aud
|
|||||||
/* Sample Freq our chan count update from ep 0 */
|
/* Sample Freq our chan count update from ep 0 */
|
||||||
case testct_byref(c_aud_ctl, tmp):
|
case testct_byref(c_aud_ctl, tmp):
|
||||||
{
|
{
|
||||||
if (tmp) {
|
if (tmp)
|
||||||
|
{
|
||||||
// is a control token sent by reboot_device
|
// is a control token sent by reboot_device
|
||||||
inct(c_aud_ctl);
|
inct(c_aud_ctl);
|
||||||
outct(c_aud_ctl, XS1_CT_END);
|
outct(c_aud_ctl, XS1_CT_END);
|
||||||
while(1) {};
|
while(1) {};
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
int min, mid, max;
|
int min, mid, max;
|
||||||
int usb_speed;
|
int usb_speed;
|
||||||
int frameTime;
|
int frameTime;
|
||||||
@@ -337,6 +332,10 @@ void buffer(register chanend c_aud_out, register chanend c_aud_in, chanend c_aud
|
|||||||
{
|
{
|
||||||
sampleFreq = inuint(c_aud_ctl);
|
sampleFreq = inuint(c_aud_ctl);
|
||||||
|
|
||||||
|
/* Don't update things for DFU command.. */
|
||||||
|
if(sampleFreq != AUDIO_STOP_FOR_DFU)
|
||||||
|
{
|
||||||
|
|
||||||
/* Tidy up double buffer, note we can do better than this for 44.1 etc but better
|
/* Tidy up double buffer, note we can do better than this for 44.1 etc but better
|
||||||
* than sending two packets at old speed! */
|
* than sending two packets at old speed! */
|
||||||
if (usb_speed == XUD_SPEED_HS)
|
if (usb_speed == XUD_SPEED_HS)
|
||||||
@@ -375,6 +374,7 @@ void buffer(register chanend c_aud_out, register chanend c_aud_in, chanend c_aud
|
|||||||
clocks = 0;
|
clocks = 0;
|
||||||
remnant = 0;
|
remnant = 0;
|
||||||
|
|
||||||
|
}
|
||||||
/* Ideally we want to wait for handshake (and pass back up) here. But we cannot keep this
|
/* Ideally we want to wait for handshake (and pass back up) here. But we cannot keep this
|
||||||
* thread locked, it must stay responsive to packets/SOFs. So, set a flag and check for
|
* thread locked, it must stay responsive to packets/SOFs. So, set a flag and check for
|
||||||
* handshake elsewhere */
|
* handshake elsewhere */
|
||||||
|
|||||||
Reference in New Issue
Block a user