aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocol/lufa/descriptor.c6
-rw-r--r--protocol/lufa/descriptor.h5
-rw-r--r--protocol/lufa/lufa.c18
3 files changed, 15 insertions, 14 deletions
diff --git a/protocol/lufa/descriptor.c b/protocol/lufa/descriptor.c
index 0536b7911..8a14c5e09 100644
--- a/protocol/lufa/descriptor.c
+++ b/protocol/lufa/descriptor.c
@@ -492,7 +492,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
492 { 492 {
493 .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, 493 .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
494 494
495 .InterfaceNumber = (NKRO_INTERFACE + 1), 495 .InterfaceNumber = MIDI_INTERFACE,
496 .AlternateSetting = 0, 496 .AlternateSetting = 0,
497 497
498 .TotalEndpoints = 0, 498 .TotalEndpoints = 0,
@@ -513,14 +513,14 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
513 .TotalLength = sizeof(USB_Audio_Descriptor_Interface_AC_t), 513 .TotalLength = sizeof(USB_Audio_Descriptor_Interface_AC_t),
514 514
515 .InCollection = 1, 515 .InCollection = 1,
516 .InterfaceNumber = (NKRO_INTERFACE + 2), 516 .InterfaceNumber = MIDI2_INTERFACE,
517 }, 517 },
518 518
519 .Audio_StreamInterface = 519 .Audio_StreamInterface =
520 { 520 {
521 .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, 521 .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
522 522
523 .InterfaceNumber = (NKRO_INTERFACE + 2), 523 .InterfaceNumber = MIDI2_INTERFACE,
524 .AlternateSetting = 0, 524 .AlternateSetting = 0,
525 525
526 .TotalEndpoints = 2, 526 .TotalEndpoints = 2,
diff --git a/protocol/lufa/descriptor.h b/protocol/lufa/descriptor.h
index 44f4c8f4a..0471ef31d 100644
--- a/protocol/lufa/descriptor.h
+++ b/protocol/lufa/descriptor.h
@@ -136,12 +136,13 @@ typedef struct
136 136
137#ifdef MIDI_ENABLE 137#ifdef MIDI_ENABLE
138# define MIDI_INTERFACE (NKRO_INTERFACE + 1) 138# define MIDI_INTERFACE (NKRO_INTERFACE + 1)
139# define MIDI2_INTERFACE (NKRO_INTERFACE + 2)
139#else 140#else
140# define MIDI_INTERFACE NKRO_INTERFACE 141# define MIDI2_INTERFACE NKRO_INTERFACE
141#endif 142#endif
142 143
143/* nubmer of interfaces */ 144/* nubmer of interfaces */
144#define TOTAL_INTERFACES (MIDI_INTERFACE + 1) 145#define TOTAL_INTERFACES MIDI2_INTERFACE + 1
145 146
146 147
147// Endopoint number and size 148// Endopoint number and size
diff --git a/protocol/lufa/lufa.c b/protocol/lufa/lufa.c
index 0bb667a4e..03b13f404 100644
--- a/protocol/lufa/lufa.c
+++ b/protocol/lufa/lufa.c
@@ -94,7 +94,7 @@ USB_ClassInfo_MIDI_Device_t USB_MIDI_Interface =
94{ 94{
95 .Config = 95 .Config =
96 { 96 {
97 .StreamingInterfaceNumber = (NKRO_INTERFACE + 2), 97 .StreamingInterfaceNumber = MIDI2_INTERFACE,
98 .DataINEndpoint = 98 .DataINEndpoint =
99 { 99 {
100 .Address = (ENDPOINT_DIR_IN | MIDI_STREAM_IN_EPNUM), 100 .Address = (ENDPOINT_DIR_IN | MIDI_STREAM_IN_EPNUM),
@@ -289,12 +289,12 @@ void EVENT_USB_Device_ConfigurationChanged(void)
289#endif 289#endif
290 290
291#ifdef MIDI_ENABLE 291#ifdef MIDI_ENABLE
292 // ConfigSuccess &= MIDI_Device_ConfigureEndpoints(&USB_MIDI_Interface); 292 ConfigSuccess &= MIDI_Device_ConfigureEndpoints(&USB_MIDI_Interface);
293 293
294 ConfigSuccess &= ENDPOINT_CONFIG(MIDI_STREAM_IN_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN, 294 // ConfigSuccess &= ENDPOINT_CONFIG(MIDI_STREAM_IN_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN,
295 MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE); 295 // MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE);
296 ConfigSuccess &= ENDPOINT_CONFIG(MIDI_STREAM_OUT_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT, 296 // ConfigSuccess &= ENDPOINT_CONFIG(MIDI_STREAM_OUT_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT,
297 MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE); 297 // MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE);
298#endif 298#endif
299 299
300} 300}
@@ -614,7 +614,7 @@ void usb_send_func(MidiDevice * device, uint16_t cnt, uint8_t byte0, uint8_t byt
614 614
615 uint8_t cable = 0; 615 uint8_t cable = 0;
616 616
617Endpoint_SelectEndpoint(MIDI_STREAM_IN_EPNUM); 617// Endpoint_SelectEndpoint(MIDI_STREAM_IN_EPNUM);
618 618
619 //if the length is undefined we assume it is a SYSEX message 619 //if the length is undefined we assume it is a SYSEX message
620 if (midi_packet_length(byte0) == UNDEFINED) { 620 if (midi_packet_length(byte0) == UNDEFINED) {
@@ -657,8 +657,8 @@ Endpoint_SelectEndpoint(MIDI_STREAM_IN_EPNUM);
657 } 657 }
658 } 658 }
659 659
660Endpoint_Write_Stream_LE(&event, sizeof(event), NULL); 660// Endpoint_Write_Stream_LE(&event, sizeof(event), NULL);
661Endpoint_ClearIN(); 661// Endpoint_ClearIN();
662 662
663 MIDI_Device_SendEventPacket(&USB_MIDI_Interface, &event); 663 MIDI_Device_SendEventPacket(&USB_MIDI_Interface, &event);
664 MIDI_Device_Flush(&USB_MIDI_Interface); 664 MIDI_Device_Flush(&USB_MIDI_Interface);