diff options
author | Dean Camera <[email protected]> | 2009-04-16 08:50:34 +0000 |
---|---|---|
committer | Dean Camera <[email protected]> | 2009-04-16 08:50:34 +0000 |
commit | 8f6b4ddf764c3a54e42d00a7502c82c5c3e71b1c (patch) | |
tree | 65c37548f19c26de3971639067d6f290095f5843 /Demos/Device/MIDI/MIDI.c | |
parent | ef06bfd1c0ef5272c32808e23d0fd60d2d1bca9c (diff) | |
download | qmk_firmware-8f6b4ddf764c3a54e42d00a7502c82c5c3e71b1c.tar.gz qmk_firmware-8f6b4ddf764c3a54e42d00a7502c82c5c3e71b1c.zip |
Fixed GenericHIDHost demo report write routine incorrect for control type requests (thanks to Andrei Krainev).
Removed Endpoint_ClearCurrentBank() and Pipe_ClearCurrentBank() in favour of new Endpoint_ClearIN(), Endpoint_ClearOUT(), Endpoint_ClearControlIN(), Endpoint_ClearControlOUT(), Pipe_ClearIN(), Pipe_ClearOUT(), Pipe_ClearControlIN() and Pipe_ClearControlOUT() macros (done to allow for the detection of packets of zero length).
Renamed *_ReadWriteAllowed() macros to *_IsReadWriteAllowed() to remain consistent with the rest of the LUFA API.
Endpoint_IsSetupReceived() macro has been renamed to Endpoint_IsSETUPReceived(), Endpoint_ClearSetupReceived() macro has been renamed to Endpoint_ClearControlSETUP(), the Pipe_IsSetupSent() macro has been renamed to Pipe_IsSETUPSent() and the Pipe_ClearSetupSent() macro is no longer applicable and should be removed - changes made to compliment the new endpoint and pipe bank management API.
Updated all demos, bootloaders and projects to use the new endpoint and pipe management APIs (thanks to Roman Thiel).
Updated library doxygen documentation, added groups, changed documentation macro functions to real functions for clarity.
Removed old endpoint and pipe aliased read/write/discard routines which did not have an explicit endian specifier for clarity.
Removed the ButtLoadTag.h header file, as no one used for its intended purpose anyway.
Diffstat (limited to 'Demos/Device/MIDI/MIDI.c')
-rw-r--r-- | Demos/Device/MIDI/MIDI.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/Demos/Device/MIDI/MIDI.c b/Demos/Device/MIDI/MIDI.c index c0e4f9df9f..e286dcbd6b 100644 --- a/Demos/Device/MIDI/MIDI.c +++ b/Demos/Device/MIDI/MIDI.c @@ -36,12 +36,6 @@ #include "MIDI.h"
-/* Project Tags, for reading out using the ButtLoad project */
-BUTTLOADTAG(ProjName, "LUFA MIDI App");
-BUTTLOADTAG(BuildTime, __TIME__);
-BUTTLOADTAG(BuildDate, __DATE__);
-BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
-
/* Scheduler Task List */
TASK_LIST
{
@@ -134,7 +128,7 @@ TASK(USB_MIDI_Task) Endpoint_SelectEndpoint(MIDI_STREAM_IN_EPNUM);
/* Check if endpoint is ready to be written to */
- if (Endpoint_ReadWriteAllowed())
+ if (Endpoint_IsINReady())
{
/* Get current joystick mask, XOR with previous to detect joystick changes */
uint8_t JoystickStatus = Joystick_GetStatus();
@@ -166,8 +160,8 @@ TASK(USB_MIDI_Task) Endpoint_SelectEndpoint(MIDI_STREAM_OUT_EPNUM);
/* Check if endpoint is ready to be read from, if so discard its (unused) data */
- if (Endpoint_ReadWriteAllowed())
- Endpoint_ClearCurrentBank();
+ if (Endpoint_IsOUTReceived())
+ Endpoint_ClearOUT();
}
/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
@@ -207,7 +201,7 @@ void UpdateStatus(uint8_t CurrentStatus) void SendMIDINoteChange(const uint8_t Pitch, const bool OnOff, const uint8_t CableID, const uint8_t Channel)
{
/* Wait until endpoint ready for more data */
- while (!(Endpoint_ReadWriteAllowed()));
+ while (!(Endpoint_IsReadWriteAllowed()));
/* Check if the message should be a Note On or Note Off command */
uint8_t Command = ((OnOff)? MIDI_COMMAND_NOTE_ON : MIDI_COMMAND_NOTE_OFF);
@@ -221,5 +215,5 @@ void SendMIDINoteChange(const uint8_t Pitch, const bool OnOff, const uint8_t Cab Endpoint_Write_Byte(MIDI_STANDARD_VELOCITY);
/* Send the data in the endpoint to the host */
- Endpoint_ClearCurrentBank();
+ Endpoint_ClearIN();
}
|