16
16
17
17
#include " MIDIUSB.h"
18
18
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
26
24
27
25
#define MIDI_RX MIDI_ENDPOINT_OUT
28
26
#define MIDI_TX MIDI_ENDPOINT_IN
@@ -40,8 +38,8 @@ MIDI_ MidiUSB;
40
38
41
39
int MIDI_::getInterface (uint8_t * interfaceNum)
42
40
{
43
- interfaceNum[0 ] += 2 ; // uses 2
44
- _midiInterface =
41
+ interfaceNum[0 ] += 2 ; // uses 2 interfaces
42
+ MIDIDescriptor _midiInterface =
45
43
{
46
44
D_IAD (MIDI_AC_INTERFACE, 2 , MIDI_AUDIO, MIDI_AUDIO_CONTROL, 0 ),
47
45
D_INTERFACE (MIDI_AC_INTERFACE,0 ,MIDI_AUDIO,MIDI_AUDIO_CONTROL,0 ),
@@ -52,28 +50,28 @@ int MIDI_::getInterface(uint8_t* interfaceNum)
52
50
D_MIDI_INJACK (MIDI_JACK_EXT, 0x2 ),
53
51
D_MIDI_OUTJACK (MIDI_JACK_EMD, 0x3 , 1 , 2 , 1 ),
54
52
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 ),
56
54
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 ),
58
56
D_MIDI_AC_JACK_EP (1 , 3 )
59
57
};
60
- return USB_SendControl (0 ,&_midiInterface,sizeof (_midiInterface));
58
+ return USB_SendControl (0 , &_midiInterface, sizeof (_midiInterface));
61
59
}
62
60
63
- bool MIDI_::setup (USBSetup& setup, uint8_t i )
61
+ bool MIDI_::setup (USBSetup& setup __attribute__ ((unused)) )
64
62
{
65
63
// Support requests here if needed. Typically these are optional
66
64
return false ;
67
65
}
68
66
69
- int MIDI_::getDescriptor (int8_t t )
67
+ int MIDI_::getDescriptor (USBSetup& setup __attribute__ ((unused)) )
70
68
{
71
69
return 0 ;
72
70
}
73
71
74
72
char * MIDI_GetShortName ()
75
73
{
76
- static char * name = " MI " ;
74
+ static char * name = " MIDI " ;
77
75
return name;
78
76
}
79
77
@@ -177,7 +175,7 @@ void MIDI_::sendMIDI(midiEventPacket_t event)
177
175
write (data, 4 );
178
176
}
179
177
180
- MIDI_::MIDI_ (void ) : PUSBListNode (2 , 2 , epType)
178
+ MIDI_::MIDI_ (void ) : PluggableUSBModule (2 , 2 , epType)
181
179
{
182
180
epType[0 ] = EP_TYPE_BULK_OUT_MIDI; // MIDI_ENDPOINT_OUT
183
181
epType[1 ] = EP_TYPE_BULK_IN_MIDI; // MIDI_ENDPOINT_IN
0 commit comments