X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/bdedbd558ce3db0d7c1e0ff6cdde2f480277aff7..1f682ca2de8df89e3fef0077b33070cf2c85e798:/Demos/Host/LowLevel/MIDIHost/MIDIHost.c diff --git a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c index 3a625555f..6964f71ea 100644 --- a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c +++ b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2009. + Copyright (C) Dean Camera, 2010. dean [at] fourwalledcubicle [dot] com www.fourwalledcubicle.com */ /* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, and distribute this software - and its documentation for any purpose and without fee is hereby - granted, provided that the above copyright notice appear in all - copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + Copyright 2010 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 + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaim all warranties with regard to this @@ -37,7 +37,7 @@ #include "MIDIHost.h" /** Main program entry point. This routine configures the hardware required by the application, then - * starts the scheduler to run the application tasks. + * enters a loop to run the application tasks in sequence. */ int main(void) { @@ -177,18 +177,18 @@ void MIDI_Host_Task(void) if (Pipe_IsINReceived()) { - USB_MIDI_EventPacket_t MIDIPacket; + USB_MIDI_EventPacket_t MIDIEvent; - Pipe_Read_Stream_LE(&MIDIPacket, sizeof(MIDIPacket)); + Pipe_Read_Stream_LE(&MIDIEvent, sizeof(MIDIEvent)); - bool NoteOnEvent = ((MIDIPacket.Command & 0x0F) == (MIDI_COMMAND_NOTE_ON >> 4)); - bool NoteOffEvent = ((MIDIPacket.Command & 0x0F) == (MIDI_COMMAND_NOTE_OFF >> 4)); + bool NoteOnEvent = ((MIDIEvent.Command & 0x0F) == (MIDI_COMMAND_NOTE_ON >> 4)); + bool NoteOffEvent = ((MIDIEvent.Command & 0x0F) == (MIDI_COMMAND_NOTE_OFF >> 4)); if (NoteOnEvent || NoteOffEvent) { - printf_P(PSTR("MIDI Note %s - Channel %d, Pitch %d, Velocity %d"), NoteOnEvent ? "On" : "Off", - ((MIDIPacket.Data1 & 0x0F) + 1), - MIDIPacket.Data2, MIDIPacket.Data3); + printf_P(PSTR("MIDI Note %s - Channel %d, Pitch %d, Velocity %d\r\n"), NoteOnEvent ? "On" : "Off", + ((MIDIEvent.Data1 & 0x0F) + 1), + MIDIEvent.Data2, MIDIEvent.Data3); } Pipe_ClearIN();