aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--avr/cores/arcore/MIDIUSB.cpp2
-rw-r--r--avr/cores/arcore/USBCore.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/avr/cores/arcore/MIDIUSB.cpp b/avr/cores/arcore/MIDIUSB.cpp
index aeec8a7..74f3320 100644
--- a/avr/cores/arcore/MIDIUSB.cpp
+++ b/avr/cores/arcore/MIDIUSB.cpp
@@ -87,7 +87,7 @@ void MIDIUSB_::accept(void)
// while we have room to store a byte
while (i != buffer->tail) {
- int c = USB_Recv(CDC_RX);
+ int c = USB_Recv(MIDI_RX);
if (c == -1)
break; // no more data
buffer->buffer[buffer->head] = c;
diff --git a/avr/cores/arcore/USBCore.cpp b/avr/cores/arcore/USBCore.cpp
index 686a2e8..8b95058 100644
--- a/avr/cores/arcore/USBCore.cpp
+++ b/avr/cores/arcore/USBCore.cpp
@@ -630,7 +630,9 @@ ISR(USB_GEN_vect)
Serial.accept();
#endif
#ifdef MIDI_ENABLED
- MIDIUSB.accept();
+ USB_Flush(MIDI_TX);
+ if (USB_Available(MIDI_RX))
+ MIDIUSB.accept();
#endif
// check whether the one-shot period has elapsed. if so, turn off the LED
if (TxLEDPulse && !(--TxLEDPulse))