Fix redefinition warning when USB_DEVICE_ONLY is set on an AVR which does not support...
authorDean Camera <dean@fourwalledcubicle.com>
Thu, 30 Jul 2009 07:45:36 +0000 (07:45 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Thu, 30 Jul 2009 07:45:36 +0000 (07:45 +0000)
Demos/Device/ClassDriver/MIDI/MIDI.c
LUFA/Drivers/USB/Class/Common/MIDI.h
LUFA/Drivers/USB/HighLevel/USBMode.h

index 243ae9e..fcb86d6 100644 (file)
@@ -67,6 +67,7 @@ int main(void)
        {\r
                CheckJoystickMovement();\r
                \r
+               /* Must acknowedge MIDI packets from the host even though they aren't used, or the host locks up */\r
                MIDI_EventPacket_t DummyMIDIEvent;\r
                MIDI_Device_ReceiveEventPacket(&Keyboard_MIDI_Interface, &DummyMIDIEvent);\r
        \r
index 7dfb0e7..a52b037 100644 (file)
                /** Type define for a USB MIDI event packet, used to encapsulate sent and received MIDI messages from a USB MIDI interface. */\r
                typedef struct\r
                {\r
-                       unsigned char Command     : 4; /**< MIDI command being sent or received in the event packet */\r
+                       unsigned char Command     : 4; /**< Upper nibble of the MIDI command being sent or received in the event packet */\r
                        unsigned char CableNumber : 4; /**< Virtual cable number of the event being sent or received in the given MIDI interface */\r
                        \r
                        uint8_t Data1; /**< First byte of data in the MIDI event */\r
index 18a2666..ba221c5 100644 (file)
@@ -50,7 +50,9 @@
                                        #error USB_HOST_ONLY is not available for the currently selected USB AVR model.\r
                                #endif\r
                                \r
-                               #define USB_DEVICE_ONLY\r
+                               #if !defined(USB_DEVICE_ONLY)\r
+                                       #define USB_DEVICE_ONLY\r
+                               #endif\r
                        #endif\r
 \r
                        #if (!defined(USB_DEVICE_ONLY) && !defined(USB_HOST_ONLY))\r