4 #ifdef TEENSY_MIDIUSB_ENABLED
6 #include <usb_private.h>
15 uint8_t c, intr_state;
19 if (!usb_configuration) {
23 UENUM = MIDI_RX_ENDPOINT;
26 if (!(c & (1 << RWAL))) {
27 if (c & (1 << RXOUTI)) {
35 packet.data[0] = UEDATX;
36 packet.data[1] = UEDATX;
37 packet.data[2] = UEDATX;
38 packet.data[3] = UEDATX;
39 if (!(UEINTX & (1 << RWAL)))
46 void write(uint8_t cn, uint8_t cin, uint8_t d0, uint8_t d1, uint8_t d2) {
47 uint8_t intr_state, timeout;
49 if (!usb_configuration)
53 UENUM = MIDI_TX_ENDPOINT;
54 timeout = UDFNUML + 2;
57 if (UEINTX & (1 << RWAL))
60 if (UDFNUML == timeout)
62 if (!usb_configuration)
66 UENUM = MIDI_TX_ENDPOINT;
68 UEDATX = (cn << 4) | cin;
72 if (!(UEINTX & (1 << RWAL)))