diff options
author | Jack Humbert <jack.humb@gmail.com> | 2017-03-28 09:26:54 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-28 09:26:54 -0400 |
commit | 7e37daa2ce6edad82de3835384176b51a8081537 (patch) | |
tree | 58f349edb063667c9ae0affd99cec2bf7a7f93cb /tmk_core/protocol | |
parent | 216f669276b30393fb35a409011ccdad8b521156 (diff) | |
parent | 0734f569409974624b40735fcd498dac9adba2d2 (diff) |
Merge pull request #1112 from newsboytko/newsboytko/midi-keycodes
Flesh out MIDI support
Diffstat (limited to 'tmk_core/protocol')
-rw-r--r-- | tmk_core/protocol/lufa/lufa.c | 19 | ||||
-rw-r--r-- | tmk_core/protocol/lufa/lufa.h | 2 |
2 files changed, 15 insertions, 6 deletions
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 4cb23ebc80..60cba8d2a9 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -1096,16 +1096,23 @@ void cc_callback(MidiDevice * device, uint8_t chan, uint8_t num, uint8_t val); void sysex_callback(MidiDevice * device, uint16_t start, uint8_t length, uint8_t * data); + +void setup_midi(void) +{ +#ifdef MIDI_ADVANCED + midi_init(); +#endif + midi_device_init(&midi_device); + midi_device_set_send_func(&midi_device, usb_send_func); + midi_device_set_pre_input_process_func(&midi_device, usb_get_midi); +} #endif int main(void) __attribute__ ((weak)); int main(void) { - #ifdef MIDI_ENABLE - midi_device_init(&midi_device); - midi_device_set_send_func(&midi_device, usb_send_func); - midi_device_set_pre_input_process_func(&midi_device, usb_get_midi); + setup_midi(); #endif setup_mcu(); @@ -1170,7 +1177,9 @@ int main(void) #ifdef MIDI_ENABLE midi_device_process(&midi_device); - // MIDI_Task(); +#ifdef MIDI_ADVANCED + midi_task(); +#endif #endif #if defined(RGBLIGHT_ANIMATIONS) & defined(RGBLIGHT_ENABLE) diff --git a/tmk_core/protocol/lufa/lufa.h b/tmk_core/protocol/lufa/lufa.h index a049fd43c9..a515737862 100644 --- a/tmk_core/protocol/lufa/lufa.h +++ b/tmk_core/protocol/lufa/lufa.h @@ -49,7 +49,7 @@ #include <LUFA/Drivers/USB/USB.h> #include "host.h" #ifdef MIDI_ENABLE - #include "midi.h" + #include "process_midi.h" #endif #ifdef __cplusplus extern "C" { |