From 3e5e5b07af1cc930be624e496c6d6cf5da79efa4 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 30 Jun 2015 04:54:36 +0200 Subject: upgraded to new lufa version of avr-utils diff --git a/software/rhmixxx/Makefile b/software/rhmixxx/Makefile index 6883376..c612c81 100644 --- a/software/rhmixxx/Makefile +++ b/software/rhmixxx/Makefile @@ -1,7 +1,7 @@ ## ## rhmidi ## -## Copyright (C) 2014 Christian Pointner +## Copyright (C) 2014-2015 Christian Pointner ## ## This file is part of rhmidi. ## @@ -26,7 +26,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 @@ -36,8 +36,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\"Radio Helsinki\"" -D USB_MANUFACTURER_LEN=14 -LUFA_OPTS += -D USB_PRODUCT="L\"rhmixxx midi controller\"" -D USB_PRODUCT_LEN=23 +LUFA_OPTS += -D USB_MANUFACTURER="L\"Radio Helsinki\"" +LUFA_OPTS += -D USB_PRODUCT="L\"rhmixxx midi controller\"" LUFA_COMPONENTS := USB USBCLASS diff --git a/software/rhmixxx/analog.c b/software/rhmixxx/analog.c index 5ddd20f..43f929c 100644 --- a/software/rhmixxx/analog.c +++ b/software/rhmixxx/analog.c @@ -1,7 +1,7 @@ /* * rhmidi * - * Copyright (C) 2014 Christian Pointner + * Copyright (C) 2014-2015 Christian Pointner * * This file is part of rhmidi. * diff --git a/software/rhmixxx/analog.h b/software/rhmixxx/analog.h index d72be94..3e093ae 100644 --- a/software/rhmixxx/analog.h +++ b/software/rhmixxx/analog.h @@ -1,7 +1,7 @@ /* * rhmidi * - * Copyright (C) 2014 Christian Pointner + * Copyright (C) 2014-2015 Christian Pointner * * This file is part of rhmidi. * diff --git a/software/rhmixxx/eventqueue.c b/software/rhmixxx/eventqueue.c index 3b093d1..61752e6 100644 --- a/software/rhmixxx/eventqueue.c +++ b/software/rhmixxx/eventqueue.c @@ -1,7 +1,7 @@ /* * rhmidi * - * Copyright (C) 2014 Christian Pointner + * Copyright (C) 2014-2015 Christian Pointner * * This file is part of rhmidi. * diff --git a/software/rhmixxx/eventqueue.h b/software/rhmixxx/eventqueue.h index 50e6d81..98535c8 100644 --- a/software/rhmixxx/eventqueue.h +++ b/software/rhmixxx/eventqueue.h @@ -1,7 +1,7 @@ /* * rhmidi * - * Copyright (C) 2014 Christian Pointner + * Copyright (C) 2014-2015 Christian Pointner * * This file is part of rhmidi. * diff --git a/software/rhmixxx/gpio.c b/software/rhmixxx/gpio.c index dcba880..fb4d325 100644 --- a/software/rhmixxx/gpio.c +++ b/software/rhmixxx/gpio.c @@ -1,7 +1,7 @@ /* * rhmidi * - * Copyright (C) 2014 Christian Pointner + * Copyright (C) 2014-2015 Christian Pointner * * This file is part of rhmidi. * diff --git a/software/rhmixxx/gpio.h b/software/rhmixxx/gpio.h index 710c4e0..9bdc9d1 100644 --- a/software/rhmixxx/gpio.h +++ b/software/rhmixxx/gpio.h @@ -1,7 +1,7 @@ /* * rhmidi * - * Copyright (C) 2014 Christian Pointner + * Copyright (C) 2014-2015 Christian Pointner * * This file is part of rhmidi. * diff --git a/software/rhmixxx/keypad.c b/software/rhmixxx/keypad.c index 1e9ca6b..7199d7c 100644 --- a/software/rhmixxx/keypad.c +++ b/software/rhmixxx/keypad.c @@ -1,7 +1,7 @@ /* * rhmidi * - * Copyright (C) 2014 Christian Pointner + * Copyright (C) 2014-2015 Christian Pointner * * This file is part of rhmidi. * diff --git a/software/rhmixxx/keypad.h b/software/rhmixxx/keypad.h index 87ab9c8..2f95533 100644 --- a/software/rhmixxx/keypad.h +++ b/software/rhmixxx/keypad.h @@ -1,7 +1,7 @@ /* * rhmidi * - * Copyright (C) 2014 Christian Pointner + * Copyright (C) 2014-2015 Christian Pointner * * This file is part of rhmidi. * diff --git a/software/rhmixxx/rhmixxx.c b/software/rhmixxx/rhmixxx.c index 33595f4..bf22ac8 100644 --- a/software/rhmixxx/rhmixxx.c +++ b/software/rhmixxx/rhmixxx.c @@ -1,7 +1,7 @@ /* * rhmidi * - * Copyright (C) 2014 Christian Pointner + * Copyright (C) 2014-2015 Christian Pointner * * This file is part of rhmidi. * @@ -27,7 +27,7 @@ /* LUFA Library - Copyright (C) Dean Camera, 2012. + Copyright (C) Dean Camera, 2014. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org @@ -41,20 +41,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) @@ -76,8 +80,7 @@ void EVENT_USB_Device_ControlRequest(void) #include "gpio.h" #include "analog.h" -#define MIDI_COMMAND_CONTROL_CHANGE 0xB0 -#define MIDI_COMMAND_PROGRAM_CHANGE 0xC0 +#define MIDI_CABLENUMBER 1 static void process_incoming_midi(void) { @@ -127,24 +130,21 @@ 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, }; MIDI_EventPacket_t MIDIEventAnalog = (MIDI_EventPacket_t) { - .CableNumber = 0, // TODO: hardcoded value - .Command = (MIDI_COMMAND_CONTROL_CHANGE >> 4), + .Event = MIDI_EVENT(MIDI_CHANNEL(MIDI_CABLENUMBER), MIDI_COMMAND_CONTROL_CHANGE), .Data1 = MIDI_COMMAND_CONTROL_CHANGE | 0, .Data2 = 0, .Data3 = 0, -- cgit v0.10.2