Make MIDI device demos also turn off the on board LEDs if MIDI Note On messages are...
[pub/USBasp.git] / Demos / Device / ClassDriver / MIDI / MIDI.c
index b704827..765bec6 100644 (file)
@@ -72,7 +72,7 @@ int main(void)
                MIDI_EventPacket_t ReceivedMIDIEvent;\r
                if (MIDI_Device_ReceiveEventPacket(&Keyboard_MIDI_Interface, &ReceivedMIDIEvent))\r
                {\r
-                       if (ReceivedMIDIEvent.Command == (MIDI_COMMAND_NOTE_ON >> 4))\r
+                       if ((ReceivedMIDIEvent.Command == (MIDI_COMMAND_NOTE_ON >> 4)) && (ReceivedMIDIEvent.Data3 > 0))\r
                          LEDs_SetAllLEDs(ReceivedMIDIEvent.Data2 > 64 ? LEDS_LED1 : LEDS_LED2);\r
                        else\r
                          LEDs_SetAllLEDs(LEDS_NO_LEDS);\r