Additional fixes to the MIDI host driver due to not unfreezing/re-freezing pipes correctly (thanks to Michael Brown).

This commit is contained in:
Dean Camera 2012-05-20 13:04:26 +00:00
parent f2ae4dc255
commit 82162c710c
2 changed files with 22 additions and 4 deletions

View file

@ -167,6 +167,7 @@ void MIDIHost_Task(void)
return;
Pipe_SelectPipe(MIDI_DATA_IN_PIPE);
Pipe_Unfreeze();
if (Pipe_IsINReceived())
{
@ -187,8 +188,11 @@ void MIDIHost_Task(void)
MIDIEvent.Data2, MIDIEvent.Data3);
}
}
Pipe_Freeze();
Pipe_SelectPipe(MIDI_DATA_OUT_PIPE);
Pipe_Unfreeze();
if (Pipe_IsOUTReady())
{
@ -251,6 +255,8 @@ void MIDIHost_Task(void)
Pipe_ClearOUT();
}
Pipe_Freeze();
/* Save previous joystick value for next joystick change detection */
PrevJoystickStatus = JoystickStatus;
}