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:
parent
e8570c4a37
commit
359fbfe14d
395 changed files with 9912 additions and 2756 deletions
|
@ -199,10 +199,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||
{
|
||||
.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
|
||||
|
||||
.EndpointAddress = (ENDPOINT_DIR_OUT | MIDI_STREAM_OUT_EPNUM),
|
||||
.EndpointAddress = MIDI_STREAM_OUT_EPADDR,
|
||||
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
|
||||
.EndpointSize = MIDI_STREAM_EPSIZE,
|
||||
.PollingIntervalMS = 0x01
|
||||
.PollingIntervalMS = 0x05
|
||||
},
|
||||
|
||||
.Refresh = 0,
|
||||
|
@ -224,10 +224,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||
{
|
||||
.Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
|
||||
|
||||
.EndpointAddress = (ENDPOINT_DIR_IN | MIDI_STREAM_IN_EPNUM),
|
||||
.EndpointAddress = MIDI_STREAM_IN_EPADDR,
|
||||
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
|
||||
.EndpointSize = MIDI_STREAM_EPSIZE,
|
||||
.PollingIntervalMS = 0x01
|
||||
.PollingIntervalMS = 0x05
|
||||
},
|
||||
|
||||
.Refresh = 0,
|
||||
|
|
|
@ -42,11 +42,11 @@
|
|||
#include <avr/pgmspace.h>
|
||||
|
||||
/* Macros: */
|
||||
/** Endpoint number of the MIDI streaming data IN endpoint, for device-to-host data transfers. */
|
||||
#define MIDI_STREAM_IN_EPNUM 2
|
||||
/** Endpoint address of the MIDI streaming data IN endpoint, for device-to-host data transfers. */
|
||||
#define MIDI_STREAM_IN_EPADDR (ENDPOINT_DIR_IN | 2)
|
||||
|
||||
/** Endpoint number of the MIDI streaming data OUT endpoint, for host-to-device data transfers. */
|
||||
#define MIDI_STREAM_OUT_EPNUM 1
|
||||
/** Endpoint address of the MIDI streaming data OUT endpoint, for host-to-device data transfers. */
|
||||
#define MIDI_STREAM_OUT_EPADDR (ENDPOINT_DIR_OUT | 1)
|
||||
|
||||
/** Endpoint size in bytes of the Audio isochronous streaming data IN and OUT endpoints. */
|
||||
#define MIDI_STREAM_EPSIZE 64
|
||||
|
|
|
@ -45,14 +45,18 @@ USB_ClassInfo_MIDI_Device_t Keyboard_MIDI_Interface =
|
|||
.Config =
|
||||
{
|
||||
.StreamingInterfaceNumber = 1,
|
||||
|
||||
.DataINEndpointNumber = MIDI_STREAM_IN_EPNUM,
|
||||
.DataINEndpointSize = MIDI_STREAM_EPSIZE,
|
||||
.DataINEndpointDoubleBank = false,
|
||||
|
||||
.DataOUTEndpointNumber = MIDI_STREAM_OUT_EPNUM,
|
||||
.DataOUTEndpointSize = MIDI_STREAM_EPSIZE,
|
||||
.DataOUTEndpointDoubleBank = false,
|
||||
.DataINEndpoint =
|
||||
{
|
||||
.Address = MIDI_STREAM_IN_EPADDR,
|
||||
.Size = MIDI_STREAM_EPSIZE,
|
||||
.Banks = 1,
|
||||
},
|
||||
.DataOUTEndpoint =
|
||||
{
|
||||
.Address = MIDI_STREAM_OUT_EPADDR,
|
||||
.Size = MIDI_STREAM_EPSIZE,
|
||||
.Banks = 1,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -96,7 +100,7 @@ int main(void)
|
|||
MIDI_EventPacket_t ReceivedMIDIEvent;
|
||||
if (MIDI_Device_ReceiveEventPacket(&Keyboard_MIDI_Interface, &ReceivedMIDIEvent))
|
||||
{
|
||||
if ((ReceivedMIDIEvent.Command == (MIDI_COMMAND_NOTE_ON >> 4)) && ((ReceivedMIDIEvent.Data1 & 0x0F) == 0))
|
||||
if ((ReceivedMIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_ON)) && ((ReceivedMIDIEvent.Data1 & 0x0F) == 0))
|
||||
{
|
||||
DDSNoteData* LRUNoteStruct = &NoteData[0];
|
||||
|
||||
|
@ -130,7 +134,7 @@ int main(void)
|
|||
/* Turn on indicator LED to indicate note generation activity */
|
||||
LEDs_SetAllLEDs(LEDS_LED1);
|
||||
}
|
||||
else if ((ReceivedMIDIEvent.Command == (MIDI_COMMAND_NOTE_OFF >> 4)) && ((ReceivedMIDIEvent.Data1 & 0x0F) == 0))
|
||||
else if ((ReceivedMIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_OFF)) && ((ReceivedMIDIEvent.Data1 & 0x0F) == 0))
|
||||
{
|
||||
bool FoundActiveNote = false;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue