1616
1717#include " MIDIUSB.h"
1818
19- #define MIDI_BUFFER_SIZE 64
20-
21- #define MIDI_AC_INTERFACE interface () // MIDI AC Interface
22- #define MIDI_INTERFACE interface ()+1
23- #define MIDI_FIRST_ENDPOINT endpoint ()
24- #define MIDI_ENDPOINT_OUT endpoint ()
25- #define MIDI_ENDPOINT_IN endpoint ()+1
19+ #define MIDI_AC_INTERFACE pluggedInterface // MIDI AC Interface
20+ #define MIDI_INTERFACE pluggedInterface+1
21+ #define MIDI_FIRST_ENDPOINT pluggedEndpoint
22+ #define MIDI_ENDPOINT_OUT pluggedEndpoint
23+ #define MIDI_ENDPOINT_IN pluggedEndpoint+1
2624
2725#define MIDI_RX MIDI_ENDPOINT_OUT
2826#define MIDI_TX MIDI_ENDPOINT_IN
@@ -40,8 +38,8 @@ MIDI_ MidiUSB;
4038
4139int MIDI_::getInterface (uint8_t * interfaceNum)
4240{
43- interfaceNum[0 ] += 2 ; // uses 2
44- _midiInterface =
41+ interfaceNum[0 ] += 2 ; // uses 2 interfaces
42+ MIDIDescriptor _midiInterface =
4543 {
4644 D_IAD (MIDI_AC_INTERFACE, 2 , MIDI_AUDIO, MIDI_AUDIO_CONTROL, 0 ),
4745 D_INTERFACE (MIDI_AC_INTERFACE,0 ,MIDI_AUDIO,MIDI_AUDIO_CONTROL,0 ),
@@ -52,28 +50,28 @@ int MIDI_::getInterface(uint8_t* interfaceNum)
5250 D_MIDI_INJACK (MIDI_JACK_EXT, 0x2 ),
5351 D_MIDI_OUTJACK (MIDI_JACK_EMD, 0x3 , 1 , 2 , 1 ),
5452 D_MIDI_OUTJACK (MIDI_JACK_EXT, 0x4 , 1 , 1 , 1 ),
55- D_MIDI_JACK_EP (USB_ENDPOINT_OUT (MIDI_ENDPOINT_OUT),USB_ENDPOINT_TYPE_BULK,64 ),
53+ D_MIDI_JACK_EP (USB_ENDPOINT_OUT (MIDI_ENDPOINT_OUT),USB_ENDPOINT_TYPE_BULK,MIDI_BUFFER_SIZE ),
5654 D_MIDI_AC_JACK_EP (1 , 1 ),
57- D_MIDI_JACK_EP (USB_ENDPOINT_IN (MIDI_ENDPOINT_IN),USB_ENDPOINT_TYPE_BULK,64 ),
55+ D_MIDI_JACK_EP (USB_ENDPOINT_IN (MIDI_ENDPOINT_IN),USB_ENDPOINT_TYPE_BULK,MIDI_BUFFER_SIZE ),
5856 D_MIDI_AC_JACK_EP (1 , 3 )
5957 };
60- return USB_SendControl (0 ,&_midiInterface,sizeof (_midiInterface));
58+ return USB_SendControl (0 , &_midiInterface, sizeof (_midiInterface));
6159}
6260
63- bool MIDI_::setup (USBSetup& setup, uint8_t i )
61+ bool MIDI_::setup (USBSetup& setup __attribute__ ((unused)) )
6462{
6563 // Support requests here if needed. Typically these are optional
6664 return false ;
6765}
6866
69- int MIDI_::getDescriptor (int8_t t )
67+ int MIDI_::getDescriptor (USBSetup& setup __attribute__ ((unused)) )
7068{
7169 return 0 ;
7270}
7371
7472char * MIDI_GetShortName ()
7573{
76- static char * name = " MI " ;
74+ static char * name = " MIDI " ;
7775 return name;
7876}
7977
@@ -177,7 +175,7 @@ void MIDI_::sendMIDI(midiEventPacket_t event)
177175 write (data, 4 );
178176}
179177
180- MIDI_::MIDI_ (void ) : PUSBListNode (2 , 2 , epType)
178+ MIDI_::MIDI_ (void ) : PluggableUSBModule (2 , 2 , epType)
181179{
182180 epType[0 ] = EP_TYPE_BULK_OUT_MIDI; // MIDI_ENDPOINT_OUT
183181 epType[1 ] = EP_TYPE_BULK_IN_MIDI; // MIDI_ENDPOINT_IN
0 commit comments