aboutsummaryrefslogtreecommitdiff
path: root/Demos/Host/LowLevel/MIDIHost/MIDIHost.c
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2011-01-10 18:43:34 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2011-01-10 18:43:34 +0000
commit7786c8b1774d81f4aa4c7da8ab8a89c515937790 (patch)
treef4b5a0aca1ac3898544effcc366380935a97d720 /Demos/Host/LowLevel/MIDIHost/MIDIHost.c
parent50ab07fab1861bae601313633e5521f649c921d2 (diff)
Altered all endpoint/pipe stream transfers so that the new BytesProcessed parameter now points to a location where the number of bytes in the transfer that have been completed can be stored (or NULL if entire transaction should be performed in one chunk).
Added new Endpoint_Null_Stream() and Pipe_Null_stream() functions. Removed the NO_STREAM_CALLBACKS compile time option due to the new partial stream transfer feature replacing it. Fixed errors in the incomplete Test and Measurement device demo preventing proper operation (thanks to Pavel Plotnikov). git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1628 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Demos/Host/LowLevel/MIDIHost/MIDIHost.c')
-rw-r--r--Demos/Host/LowLevel/MIDIHost/MIDIHost.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c
index d9060ccb..22e588ca 100644
--- a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c
+++ b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c
@@ -181,7 +181,10 @@ void MIDI_Host_Task(void)
{
MIDI_EventPacket_t MIDIEvent;
- Pipe_Read_Stream_LE(&MIDIEvent, sizeof(MIDIEvent));
+ Pipe_Read_Stream_LE(&MIDIEvent, sizeof(MIDIEvent), NULL);
+
+ if (!(Pipe_BytesInPipe()))
+ Pipe_ClearIN();
bool NoteOnEvent = ((MIDIEvent.Command & 0x0F) == (MIDI_COMMAND_NOTE_ON >> 4));
bool NoteOffEvent = ((MIDIEvent.Command & 0x0F) == (MIDI_COMMAND_NOTE_OFF >> 4));
@@ -191,10 +194,7 @@ void MIDI_Host_Task(void)
printf_P(PSTR("MIDI Note %s - Channel %d, Pitch %d, Velocity %d\r\n"), NoteOnEvent ? "On" : "Off",
((MIDIEvent.Data1 & 0x0F) + 1),
MIDIEvent.Data2, MIDIEvent.Data3);
- }
-
- if (!(Pipe_BytesInPipe()))
- Pipe_ClearIN();
+ }
}
Pipe_SelectPipe(MIDI_DATA_OUT_PIPE);
@@ -255,7 +255,7 @@ void MIDI_Host_Task(void)
};
/* Write the MIDI event packet to the pipe */
- Pipe_Write_Stream_LE(&MIDIEvent, sizeof(MIDIEvent));
+ Pipe_Write_Stream_LE(&MIDIEvent, sizeof(MIDIEvent), NULL);
/* Send the data in the pipe to the device */
Pipe_ClearOUT();