diff options
| -rw-r--r-- | tmk_core/protocol/chibios/main.c | 6 | ||||
| -rw-r--r-- | tmk_core/protocol/chibios/usb_main.c | 12 |
2 files changed, 17 insertions, 1 deletions
diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index 4b66bc522..a61ffad12 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c | |||
| @@ -81,6 +81,9 @@ void raw_hid_task(void); | |||
| 81 | #ifdef CONSOLE_ENABLE | 81 | #ifdef CONSOLE_ENABLE |
| 82 | void console_task(void); | 82 | void console_task(void); |
| 83 | #endif | 83 | #endif |
| 84 | #ifdef MIDI_ENABLE | ||
| 85 | void midi_ep_task(void); | ||
| 86 | #endif | ||
| 84 | 87 | ||
| 85 | /* TESTING | 88 | /* TESTING |
| 86 | * Amber LED blinker thread, times are in milliseconds. | 89 | * Amber LED blinker thread, times are in milliseconds. |
| @@ -214,6 +217,9 @@ int main(void) { | |||
| 214 | #ifdef CONSOLE_ENABLE | 217 | #ifdef CONSOLE_ENABLE |
| 215 | console_task(); | 218 | console_task(); |
| 216 | #endif | 219 | #endif |
| 220 | #ifdef MIDI_ENABLE | ||
| 221 | midi_ep_task(); | ||
| 222 | #endif | ||
| 217 | #ifdef VIRTSER_ENABLE | 223 | #ifdef VIRTSER_ENABLE |
| 218 | virtser_task(); | 224 | virtser_task(); |
| 219 | #endif | 225 | #endif |
diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index dd701f661..d5eeffcbe 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c | |||
| @@ -833,7 +833,17 @@ bool recv_midi_packet(MIDI_EventPacket_t *const event) { | |||
| 833 | size_t size = chnReadTimeout(&drivers.midi_driver.driver, (uint8_t *)event, sizeof(MIDI_EventPacket_t), TIME_IMMEDIATE); | 833 | size_t size = chnReadTimeout(&drivers.midi_driver.driver, (uint8_t *)event, sizeof(MIDI_EventPacket_t), TIME_IMMEDIATE); |
| 834 | return size == sizeof(MIDI_EventPacket_t); | 834 | return size == sizeof(MIDI_EventPacket_t); |
| 835 | } | 835 | } |
| 836 | 836 | void midi_ep_task(void) { | |
| 837 | uint8_t buffer[MIDI_STREAM_EPSIZE]; | ||
| 838 | size_t size = 0; | ||
| 839 | do { | ||
| 840 | size_t size = chnReadTimeout(&drivers.midi_driver.driver, buffer, sizeof(buffer), TIME_IMMEDIATE); | ||
| 841 | if (size > 0) { | ||
| 842 | MIDI_EventPacket_t event; | ||
| 843 | recv_midi_packet(&event); | ||
| 844 | } | ||
| 845 | } while (size > 0); | ||
| 846 | } | ||
| 837 | #endif | 847 | #endif |
| 838 | 848 | ||
| 839 | #ifdef VIRTSER_ENABLE | 849 | #ifdef VIRTSER_ENABLE |
