Add NO_INTERNAL_SERIAL compile time option to bootloaders to prevent them from having...
[pub/USBasp.git] / Demos / Device / ClassDriver / MIDI / MIDI.c
index 234adca..3dca743 100644 (file)
  *  passed to all MIDI Class driver functions, so that multiple instances of the same class\r
  *  within a device can be differentiated from one another.\r
  */\r
-USB_ClassInfo_MIDI_t Keyboard_MIDI_Interface =\r
+USB_ClassInfo_MIDI_Device_t Keyboard_MIDI_Interface =\r
        {\r
-               .StreamingInterfaceNumber = 1,\r
+               .Config =\r
+                       {\r
+                               .StreamingInterfaceNumber = 1,\r
 \r
-               .DataINEndpointNumber     = MIDI_STREAM_IN_EPNUM,\r
-               .DataINEndpointSize       = MIDI_STREAM_EPSIZE,\r
+                               .DataINEndpointNumber     = MIDI_STREAM_IN_EPNUM,\r
+                               .DataINEndpointSize       = MIDI_STREAM_EPSIZE,\r
 \r
-               .DataOUTEndpointNumber    = MIDI_STREAM_OUT_EPNUM,\r
-               .DataOUTEndpointSize      = MIDI_STREAM_EPSIZE,\r
+                               .DataOUTEndpointNumber    = MIDI_STREAM_OUT_EPNUM,\r
+                               .DataOUTEndpointSize      = MIDI_STREAM_EPSIZE,\r
+                       },\r
+                       \r
+               .State =\r
+                       {\r
+                               // Leave all state values to their defaults                     \r
+                       }\r
        };\r
 \r
 /** Main program entry point. This routine contains the overall program flow, including initial\r
@@ -139,9 +147,9 @@ void CheckJoystickMovement(void)
                USB_MIDI_EventPacket_t MIDIEvent = (USB_MIDI_EventPacket_t)\r
                        {\r
                                .CableNumber = 0,\r
-                               .Command     = MIDICommand,\r
+                               .Command     = (MIDICommand >> 4),\r
                                \r
-                               .Data1       = (MIDICommand << 4) | Channel,\r
+                               .Data1       = MIDICommand | Channel,\r
                                .Data2       = MIDIPitch,\r
                                .Data3       = MIDI_STANDARD_VELOCITY,                  \r
                        };\r