Add branch for the conversion of demos to use standard C header files for configuration, rather than makefile defined macros.

This commit is contained in:
Dean Camera 2012-05-10 19:24:58 +00:00
parent e8570c4a37
commit 359fbfe14d
395 changed files with 9912 additions and 2756 deletions

View file

@ -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;

View file

@ -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. */

View file

@ -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,