Fix "grep: Version.h: No such file or directory" error when including the core LUFA...
[pub/USBasp.git] / Projects / MIDIToneGenerator / MIDIToneGenerator.c
index a068d75..2505a3e 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2011.
+     Copyright (C) Dean Camera, 2013.
 
   dean [at] fourwalledcubicle [dot] com
-      www.fourwalledcubicle.com
+           www.lufa-lib.org
 */
 
 /*
-  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2013  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
@@ -18,7 +18,7 @@
   advertising or publicity pertaining to distribution of the
   software without specific, written prior permission.
 
-  The author disclaim all warranties with regard to this
+  The author disclaims all warranties with regard to this
   software, including all implied warranties of merchantability
   and fitness.  In no event shall the author be liable for any
   special, indirect or consequential damages or any damages
@@ -45,14 +45,18 @@ USB_ClassInfo_MIDI_Device_t Keyboard_MIDI_Interface =
                .Config =
                        {
                                .StreamingInterfaceNumber = 1,
-
-                               .DataINEndpointNumber      = MIDI_STREAM_IN_EPNUM,
-                               .DataINEndpointSize        = MIDI_STREAM_EPSIZE,
-                               .DataINEndpointDoubleBank  = false,
-
-                               .DataOUTEndpointNumber     = MIDI_STREAM_OUT_EPNUM,
-                               .DataOUTEndpointSize       = MIDI_STREAM_EPSIZE,
-                               .DataOUTEndpointDoubleBank = false,
+                               .DataINEndpoint           =
+                                       {
+                                               .Address          = MIDI_STREAM_IN_EPADDR,
+                                               .Size             = MIDI_STREAM_EPSIZE,
+                                               .Banks            = 1,
+                                       },
+                               .DataOUTEndpoint           =
+                                       {
+                                               .Address          = MIDI_STREAM_OUT_EPADDR,
+                                               .Size             = MIDI_STREAM_EPSIZE,
+                                               .Banks            = 1,
+                                       },
                        },
        };
 
@@ -89,14 +93,14 @@ int main(void)
        SetupHardware();
 
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
-       sei();
+       GlobalInterruptEnable();
 
        for (;;)
        {
                MIDI_EventPacket_t ReceivedMIDIEvent;
                if (MIDI_Device_ReceiveEventPacket(&Keyboard_MIDI_Interface, &ReceivedMIDIEvent))
                {
-                       if ((ReceivedMIDIEvent.Command == (MIDI_COMMAND_NOTE_ON >> 4)) && ((ReceivedMIDIEvent.Data1 & 0x0F) == 0))
+                       if ((ReceivedMIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_ON)) && ((ReceivedMIDIEvent.Data1 & 0x0F) == 0))
                        {
                                DDSNoteData* LRUNoteStruct = &NoteData[0];
 
@@ -130,7 +134,7 @@ int main(void)
                                /* Turn on indicator LED to indicate note generation activity */
                                LEDs_SetAllLEDs(LEDS_LED1);
                        }
-                       else if ((ReceivedMIDIEvent.Command == (MIDI_COMMAND_NOTE_OFF >> 4)) && ((ReceivedMIDIEvent.Data1 & 0x0F) == 0))
+                       else if ((ReceivedMIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_OFF)) && ((ReceivedMIDIEvent.Data1 & 0x0F) == 0))
                        {
                                bool FoundActiveNote = false;