diff options
author | Ryan <fauxpark@gmail.com> | 2021-10-06 19:34:46 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-06 19:34:46 +1100 |
commit | d8f0c8783a0da2e5f49d10bb0119a5be7bb4b261 (patch) | |
tree | c2e7a99d6cf3d67dd3ee60975865264d94c55ce6 /tmk_core | |
parent | a94c6fa620ce8daf6436773accec89965c675ce5 (diff) | |
download | qmk_firmware-d8f0c8783a0da2e5f49d10bb0119a5be7bb4b261.tar.gz qmk_firmware-d8f0c8783a0da2e5f49d10bb0119a5be7bb4b261.zip |
Remove sysex API (#14723)
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/protocol/lufa/lufa.h | 11 | ||||
-rw-r--r-- | tmk_core/protocol/midi/qmk_midi.c | 41 |
2 files changed, 0 insertions, 52 deletions
diff --git a/tmk_core/protocol/lufa/lufa.h b/tmk_core/protocol/lufa/lufa.h index 348a84c03..6a5205609 100644 --- a/tmk_core/protocol/lufa/lufa.h +++ b/tmk_core/protocol/lufa/lufa.h | |||
@@ -56,14 +56,3 @@ extern host_driver_t lufa_driver; | |||
56 | #ifdef __cplusplus | 56 | #ifdef __cplusplus |
57 | } | 57 | } |
58 | #endif | 58 | #endif |
59 | |||
60 | #ifdef API_ENABLE | ||
61 | # include "api.h" | ||
62 | #endif | ||
63 | |||
64 | #ifdef API_SYSEX_ENABLE | ||
65 | # include "api_sysex.h" | ||
66 | // Allocate space for encoding overhead. | ||
67 | // The header and terminator are not stored to save a few bytes of precious ram | ||
68 | # define MIDI_SYSEX_BUFFER (API_SYSEX_MAX_SIZE + API_SYSEX_MAX_SIZE / 7 + (API_SYSEX_MAX_SIZE % 7 ? 1 : 0)) | ||
69 | #endif | ||
diff --git a/tmk_core/protocol/midi/qmk_midi.c b/tmk_core/protocol/midi/qmk_midi.c index c18dbf993..3a454d61a 100644 --- a/tmk_core/protocol/midi/qmk_midi.c +++ b/tmk_core/protocol/midi/qmk_midi.c | |||
@@ -4,9 +4,6 @@ | |||
4 | #include "midi.h" | 4 | #include "midi.h" |
5 | #include "usb_descriptor.h" | 5 | #include "usb_descriptor.h" |
6 | #include "process_midi.h" | 6 | #include "process_midi.h" |
7 | #if API_SYSEX_ENABLE | ||
8 | # include "api_sysex.h" | ||
9 | #endif | ||
10 | 7 | ||
11 | /******************************************************************************* | 8 | /******************************************************************************* |
12 | * MIDI | 9 | * MIDI |
@@ -124,41 +121,6 @@ static void cc_callback(MidiDevice* device, uint8_t chan, uint8_t num, uint8_t v | |||
124 | // midi_send_cc(device, (chan + 1) % 16, num, val); | 121 | // midi_send_cc(device, (chan + 1) % 16, num, val); |
125 | } | 122 | } |
126 | 123 | ||
127 | #ifdef API_SYSEX_ENABLE | ||
128 | uint8_t midi_buffer[MIDI_SYSEX_BUFFER] = {0}; | ||
129 | |||
130 | static void sysex_callback(MidiDevice* device, uint16_t start, uint8_t length, uint8_t* data) { | ||
131 | // SEND_STRING("\n"); | ||
132 | // send_word(start); | ||
133 | // SEND_STRING(": "); | ||
134 | // Don't store the header | ||
135 | int16_t pos = start - 4; | ||
136 | for (uint8_t place = 0; place < length; place++) { | ||
137 | // send_byte(*data); | ||
138 | if (pos >= 0) { | ||
139 | if (*data == 0xF7) { | ||
140 | // SEND_STRING("\nRD: "); | ||
141 | // for (uint8_t i = 0; i < start + place + 1; i++){ | ||
142 | // send_byte(midi_buffer[i]); | ||
143 | // SEND_STRING(" "); | ||
144 | // } | ||
145 | const unsigned decoded_length = sysex_decoded_length(pos); | ||
146 | uint8_t decoded[API_SYSEX_MAX_SIZE]; | ||
147 | sysex_decode(decoded, midi_buffer, pos); | ||
148 | process_api(decoded_length, decoded); | ||
149 | return; | ||
150 | } else if (pos >= MIDI_SYSEX_BUFFER) { | ||
151 | return; | ||
152 | } | ||
153 | midi_buffer[pos] = *data; | ||
154 | } | ||
155 | // SEND_STRING(" "); | ||
156 | data++; | ||
157 | pos++; | ||
158 | } | ||
159 | } | ||
160 | #endif | ||
161 | |||
162 | void midi_init(void); | 124 | void midi_init(void); |
163 | 125 | ||
164 | void setup_midi(void) { | 126 | void setup_midi(void) { |
@@ -170,7 +132,4 @@ void setup_midi(void) { | |||
170 | midi_device_set_pre_input_process_func(&midi_device, usb_get_midi); | 132 | midi_device_set_pre_input_process_func(&midi_device, usb_get_midi); |
171 | midi_register_fallthrough_callback(&midi_device, fallthrough_callback); | 133 | midi_register_fallthrough_callback(&midi_device, fallthrough_callback); |
172 | midi_register_cc_callback(&midi_device, cc_callback); | 134 | midi_register_cc_callback(&midi_device, cc_callback); |
173 | #ifdef API_SYSEX_ENABLE | ||
174 | midi_register_sysex_callback(&midi_device, sysex_callback); | ||
175 | #endif | ||
176 | } | 135 | } |