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 | |
| parent | 216f669276b30393fb35a409011ccdad8b521156 (diff) | |
| parent | 0734f569409974624b40735fcd498dac9adba2d2 (diff) | |
| download | qmk_firmware-7e37daa2ce6edad82de3835384176b51a8081537.tar.gz qmk_firmware-7e37daa2ce6edad82de3835384176b51a8081537.zip | |
Merge pull request #1112 from newsboytko/newsboytko/midi-keycodes
Flesh out MIDI support
Diffstat (limited to 'tmk_core')
| -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 4cb23ebc8..60cba8d2a 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c | |||
| @@ -1096,16 +1096,23 @@ void cc_callback(MidiDevice * device, | |||
| 1096 | uint8_t chan, uint8_t num, uint8_t val); | 1096 | uint8_t chan, uint8_t num, uint8_t val); |
| 1097 | void sysex_callback(MidiDevice * device, | 1097 | void sysex_callback(MidiDevice * device, |
| 1098 | uint16_t start, uint8_t length, uint8_t * data); | 1098 | uint16_t start, uint8_t length, uint8_t * data); |
| 1099 | |||
| 1100 | void setup_midi(void) | ||
| 1101 | { | ||
| 1102 | #ifdef MIDI_ADVANCED | ||
| 1103 | midi_init(); | ||
| 1104 | #endif | ||
| 1105 | midi_device_init(&midi_device); | ||
| 1106 | midi_device_set_send_func(&midi_device, usb_send_func); | ||
| 1107 | midi_device_set_pre_input_process_func(&midi_device, usb_get_midi); | ||
| 1108 | } | ||
| 1099 | #endif | 1109 | #endif |
| 1100 | 1110 | ||
| 1101 | int main(void) __attribute__ ((weak)); | 1111 | int main(void) __attribute__ ((weak)); |
| 1102 | int main(void) | 1112 | int main(void) |
| 1103 | { | 1113 | { |
| 1104 | |||
| 1105 | #ifdef MIDI_ENABLE | 1114 | #ifdef MIDI_ENABLE |
| 1106 | midi_device_init(&midi_device); | 1115 | setup_midi(); |
| 1107 | midi_device_set_send_func(&midi_device, usb_send_func); | ||
| 1108 | midi_device_set_pre_input_process_func(&midi_device, usb_get_midi); | ||
| 1109 | #endif | 1116 | #endif |
| 1110 | 1117 | ||
| 1111 | setup_mcu(); | 1118 | setup_mcu(); |
| @@ -1170,7 +1177,9 @@ int main(void) | |||
| 1170 | 1177 | ||
| 1171 | #ifdef MIDI_ENABLE | 1178 | #ifdef MIDI_ENABLE |
| 1172 | midi_device_process(&midi_device); | 1179 | midi_device_process(&midi_device); |
| 1173 | // MIDI_Task(); | 1180 | #ifdef MIDI_ADVANCED |
| 1181 | midi_task(); | ||
| 1182 | #endif | ||
| 1174 | #endif | 1183 | #endif |
| 1175 | 1184 | ||
| 1176 | #if defined(RGBLIGHT_ANIMATIONS) & defined(RGBLIGHT_ENABLE) | 1185 | #if defined(RGBLIGHT_ANIMATIONS) & defined(RGBLIGHT_ENABLE) |
diff --git a/tmk_core/protocol/lufa/lufa.h b/tmk_core/protocol/lufa/lufa.h index a049fd43c..a51573786 100644 --- a/tmk_core/protocol/lufa/lufa.h +++ b/tmk_core/protocol/lufa/lufa.h | |||
| @@ -49,7 +49,7 @@ | |||
| 49 | #include <LUFA/Drivers/USB/USB.h> | 49 | #include <LUFA/Drivers/USB/USB.h> |
| 50 | #include "host.h" | 50 | #include "host.h" |
| 51 | #ifdef MIDI_ENABLE | 51 | #ifdef MIDI_ENABLE |
| 52 | #include "midi.h" | 52 | #include "process_midi.h" |
| 53 | #endif | 53 | #endif |
| 54 | #ifdef __cplusplus | 54 | #ifdef __cplusplus |
| 55 | extern "C" { | 55 | extern "C" { |
