aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/LowLevel/MIDIHost
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2012-05-10 19:24:58 +0000
committerDean Camera <dean@fourwalledcubicle.com>2012-05-10 19:24:58 +0000
commit359fbfe14d00ab378f85a36664820ea9ba538c3f (patch)
tree0929d5663a3be4dc078dda0aba5ba798ebb627ab /Demos/Host/LowLevel/MIDIHost
parente8570c4a37e41117e3fd1e989e0b41f1e9608f3c (diff)
downloadlufa-359fbfe14d00ab378f85a36664820ea9ba538c3f.tar.gz
lufa-359fbfe14d00ab378f85a36664820ea9ba538c3f.tar.bz2
lufa-359fbfe14d00ab378f85a36664820ea9ba538c3f.zip
Add branch for the conversion of demos to use standard C header files for configuration, rather than makefile defined macros.
Diffstat (limited to 'Demos/Host/LowLevel/MIDIHost')
-rw-r--r--Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.c6
-rw-r--r--Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h8
-rw-r--r--Demos/Host/LowLevel/MIDIHost/MIDIHost.c7
3 files changed, 9 insertions, 12 deletions
diff --git a/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.c b/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.c
index 39e513cf6..70381ea56 100644
--- a/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.c
+++ b/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.c
@@ -105,12 +105,10 @@ uint8_t ProcessConfigurationDescriptor(void)
}
/* Configure the MIDI data IN pipe */
- Pipe_ConfigurePipe(MIDI_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN,
- DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(MIDI_DATA_IN_PIPE, EP_TYPE_BULK, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1);
/* Configure the MIDI data OUT pipe */
- Pipe_ConfigurePipe(MIDI_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT,
- DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+ Pipe_ConfigurePipe(MIDI_DATA_OUT_PIPE, EP_TYPE_BULK, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1);
/* Valid data found, return success */
return SuccessfulConfigRead;
diff --git a/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h b/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h
index d41513e4e..40d4dc9cc 100644
--- a/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h
+++ b/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h
@@ -42,11 +42,11 @@
#include "MIDIHost.h"
/* Macros: */
- /** Pipe number for the MIDI data IN pipe. */
- #define MIDI_DATA_IN_PIPE 1
+ /** Pipe address for the MIDI data IN pipe. */
+ #define MIDI_DATA_IN_PIPE (PIPE_DIR_IN | 1)
- /** Pipe number for the MIDI data OUT pipe. */
- #define MIDI_DATA_OUT_PIPE 2
+ /** Pipe address for the MIDI data OUT pipe. */
+ #define MIDI_DATA_OUT_PIPE (PIPE_DIR_OUT | 2)
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */
diff --git a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c
index 060761f58..f4a52accd 100644
--- a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c
+++ b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c
@@ -177,8 +177,8 @@ void MIDIHost_Task(void)
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));
+ bool NoteOnEvent = (MIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_ON));
+ bool NoteOffEvent = (MIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_OFF));
if (NoteOnEvent || NoteOffEvent)
{
@@ -237,8 +237,7 @@ void MIDIHost_Task(void)
{
MIDI_EventPacket_t MIDIEvent = (MIDI_EventPacket_t)
{
- .CableNumber = 0,
- .Command = (MIDICommand >> 4),
+ .Event = MIDI_EVENT(0, MIDICommand),
.Data1 = MIDICommand | Channel,
.Data2 = MIDIPitch,