aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-06-04 03:03:48 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-06-04 03:03:48 +0000
commit4897ef8972d1cff73d39abf282e85d253dd119f2 (patch)
tree79aef362ae8917db2ab09e3a51b2f933264db956
parenta67bd74e3e8aad87dcee8cf0c0eaaccbe7d00552 (diff)
downloadlufa-4897ef8972d1cff73d39abf282e85d253dd119f2.tar.gz
lufa-4897ef8972d1cff73d39abf282e85d253dd119f2.tar.bz2
lufa-4897ef8972d1cff73d39abf282e85d253dd119f2.zip
Ensure all USB device class drivers have the same three main functions as their interface for consistency.
-rw-r--r--Demos/Device/AudioInput/AudioInput.c1
-rw-r--r--Demos/Device/AudioOutput/AudioOutput.c1
-rw-r--r--Demos/Device/MIDI/MIDI.c7
-rw-r--r--LUFA/Drivers/USB/Class/Device/Audio.c5
-rw-r--r--LUFA/Drivers/USB/Class/Device/MIDI.c10
-rw-r--r--LUFA/Drivers/USB/Class/Device/MIDI.h1
6 files changed, 25 insertions, 0 deletions
diff --git a/Demos/Device/AudioInput/AudioInput.c b/Demos/Device/AudioInput/AudioInput.c
index 31b3159e0..93ffe0bf4 100644
--- a/Demos/Device/AudioInput/AudioInput.c
+++ b/Demos/Device/AudioInput/AudioInput.c
@@ -62,6 +62,7 @@ int main(void)
if (Microphone_Audio_Interface.InterfaceEnabled)
ProcessNextSample();
+ USB_Audio_USBTask(&Microphone_Audio_Interface);
USB_USBTask();
}
}
diff --git a/Demos/Device/AudioOutput/AudioOutput.c b/Demos/Device/AudioOutput/AudioOutput.c
index 4ff2e7453..8c3bf6188 100644
--- a/Demos/Device/AudioOutput/AudioOutput.c
+++ b/Demos/Device/AudioOutput/AudioOutput.c
@@ -62,6 +62,7 @@ int main(void)
if (Speaker_Audio_Interface.InterfaceEnabled)
ProcessNextSample();
+ USB_Audio_USBTask(&Speaker_Audio_Interface);
USB_USBTask();
}
}
diff --git a/Demos/Device/MIDI/MIDI.c b/Demos/Device/MIDI/MIDI.c
index 4fef04754..8881d1dc7 100644
--- a/Demos/Device/MIDI/MIDI.c
+++ b/Demos/Device/MIDI/MIDI.c
@@ -64,6 +64,7 @@ int main(void)
{
CheckJoystickMovement();
+ USB_MIDI_USBTask(&Keyboard_MIDI_Interface);
USB_USBTask();
}
}
@@ -168,3 +169,9 @@ void EVENT_USB_ConfigurationChanged(void)
if (!(USB_MIDI_ConfigureEndpoints(&Keyboard_MIDI_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
+
+/** Event handler for the library USB Unhandled Control Packet event. */
+void EVENT_USB_UnhandledControlPacket(void)
+{
+ USB_MIDI_ProcessControlPacket(&Keyboard_MIDI_Interface);
+}
diff --git a/LUFA/Drivers/USB/Class/Device/Audio.c b/LUFA/Drivers/USB/Class/Device/Audio.c
index acd9f6956..4651bf153 100644
--- a/LUFA/Drivers/USB/Class/Device/Audio.c
+++ b/LUFA/Drivers/USB/Class/Device/Audio.c
@@ -80,6 +80,11 @@ bool USB_Audio_ConfigureEndpoints(USB_ClassInfo_Audio_t* AudioInterfaceInfo)
return true;
}
+void USB_Audio_USBTask(USB_ClassInfo_Audio_t* AudioInterfaceInfo)
+{
+
+}
+
int8_t USB_Audio_ReadSample8(void)
{
int8_t Sample;
diff --git a/LUFA/Drivers/USB/Class/Device/MIDI.c b/LUFA/Drivers/USB/Class/Device/MIDI.c
index 42c06904b..f96604bb6 100644
--- a/LUFA/Drivers/USB/Class/Device/MIDI.c
+++ b/LUFA/Drivers/USB/Class/Device/MIDI.c
@@ -30,6 +30,11 @@
#include "MIDI.h"
+void USB_MIDI_ProcessControlPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo)
+{
+
+}
+
bool USB_MIDI_ConfigureEndpoints(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo)
{
if (MIDIInterfaceInfo->DataINEndpointNumber)
@@ -55,6 +60,11 @@ bool USB_MIDI_ConfigureEndpoints(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo)
return true;
}
+void USB_MIDI_USBTask(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo)
+{
+
+}
+
void USB_MIDI_SendEventPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event)
{
if (!(USB_IsConnected))
diff --git a/LUFA/Drivers/USB/Class/Device/MIDI.h b/LUFA/Drivers/USB/Class/Device/MIDI.h
index 890d3bb55..d15872263 100644
--- a/LUFA/Drivers/USB/Class/Device/MIDI.h
+++ b/LUFA/Drivers/USB/Class/Device/MIDI.h
@@ -155,6 +155,7 @@
/* Function Prototypes: */
bool USB_MIDI_ConfigureEndpoints(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo);
+ void USB_MIDI_ProcessControlPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo);
void USB_MIDI_USBTask(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo);
void USB_MIDI_SendEventPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event);