summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2015-06-30 03:13:53 (GMT)
committerChristian Pointner <equinox@spreadspace.org>2015-06-30 03:13:53 (GMT)
commit5141478f9fbf09e142daaf0aabe79a29866b39c7 (patch)
treea5a0d90a93476dff6db4fcf490bcc0beca9fa840
parent32007761785e61057a8495491d4a77b7233264b1 (diff)
upgraded to new lufa version of avr-utils
-rw-r--r--dolmetsch-ctl/Makefile6
-rw-r--r--dolmetsch-ctl/dolmetsch-ctl.c41
2 files changed, 24 insertions, 23 deletions
diff --git a/dolmetsch-ctl/Makefile b/dolmetsch-ctl/Makefile
index badf9a0..d662022 100644
--- a/dolmetsch-ctl/Makefile
+++ b/dolmetsch-ctl/Makefile
@@ -27,7 +27,7 @@ LIBS := util led lufa-descriptor-midi
EXTERNAL_LIBS := lufa
SPREADAVR_PATH := ../contrib/avr-utils
-LUFA_PATH := $(SPREADAVR_PATH)/contrib/LUFA-120219
+LUFA_PATH := $(SPREADAVR_PATH)/contrib/lufa-LUFA-140928
LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0
LUFA_OPTS += -D ORDERED_EP_CONFIG
@@ -37,8 +37,8 @@ LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
LUFA_OPTS += -D INTERRUPT_CONTROL_ENDPOINT
-LUFA_OPTS += -D USB_MANUFACTURER="L\"equinox\"" -D USB_MANUFACTURER_LEN=7
-LUFA_OPTS += -D USB_PRODUCT="L\"dolmetsch controller\"" -D USB_PRODUCT_LEN=20
+LUFA_OPTS += -D USB_MANUFACTURER="L\"equinox\""
+LUFA_OPTS += -D USB_PRODUCT="L\"dolmetsch controller\""
LUFA_COMPONENTS := USB USBCLASS
diff --git a/dolmetsch-ctl/dolmetsch-ctl.c b/dolmetsch-ctl/dolmetsch-ctl.c
index 85aad6f..1308a5b 100644
--- a/dolmetsch-ctl/dolmetsch-ctl.c
+++ b/dolmetsch-ctl/dolmetsch-ctl.c
@@ -42,20 +42,24 @@
* within a device can be differentiated from one another.
*/
USB_ClassInfo_MIDI_Device_t 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,
- },
- };
+ {
+ .Config =
+ {
+ .StreamingInterfaceNumber = INTERFACE_ID_AudioStream,
+ .DataINEndpoint =
+ {
+ .Address = MIDI_STREAM_IN_EPADDR,
+ .Size = MIDI_STREAM_EPSIZE,
+ .Banks = 1,
+ },
+ .DataOUTEndpoint =
+ {
+ .Address = MIDI_STREAM_OUT_EPADDR,
+ .Size = MIDI_STREAM_EPSIZE,
+ .Banks = 1,
+ },
+ },
+ };
/** Event handler for the library USB Configuration Changed event. */
void EVENT_USB_Device_ConfigurationChanged(void)
@@ -75,8 +79,7 @@ void EVENT_USB_Device_ControlRequest(void)
#include "keypad.h"
#include "eventqueue.h"
-#define MIDI_COMMAND_CONTROL_CHANGE 0xB0
-#define MIDI_COMMAND_PROGRAM_CHANGE 0xC0
+#define MIDI_CABLENUMBER 1
static void process_incoming_midi(void)
{
@@ -109,16 +112,14 @@ static void process_outgoing_midi(void)
{
MIDI_EventPacket_t MIDIEventOn = (MIDI_EventPacket_t)
{
- .CableNumber = 0, // TODO: hardcoded value
- .Command = (MIDI_COMMAND_NOTE_ON >> 4),
+ .Event = MIDI_EVENT(MIDI_CHANNEL(MIDI_CABLENUMBER), MIDI_COMMAND_NOTE_ON),
.Data1 = MIDI_COMMAND_NOTE_ON | 0,
.Data2 = 0,
.Data3 = 0x7F,
};
MIDI_EventPacket_t MIDIEventOff = (MIDI_EventPacket_t)
{
- .CableNumber = 0, // TODO: hardcoded value
- .Command = (MIDI_COMMAND_NOTE_OFF >> 4),
+ .Event = MIDI_EVENT(MIDI_CHANNEL(MIDI_CABLENUMBER), MIDI_COMMAND_NOTE_OFF),
.Data1 = MIDI_COMMAND_NOTE_OFF | 0,
.Data2 = 0,
.Data3 = 0,