From d8f0c8783a0da2e5f49d10bb0119a5be7bb4b261 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 6 Oct 2021 19:34:46 +1100 Subject: Remove sysex API (#14723) --- tmk_core/protocol/lufa/lufa.h | 11 ----------- tmk_core/protocol/midi/qmk_midi.c | 41 --------------------------------------- 2 files changed, 52 deletions(-) (limited to 'tmk_core/protocol') diff --git a/tmk_core/protocol/lufa/lufa.h b/tmk_core/protocol/lufa/lufa.h index 348a84c031..6a5205609e 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; #ifdef __cplusplus } #endif - -#ifdef API_ENABLE -# include "api.h" -#endif - -#ifdef API_SYSEX_ENABLE -# include "api_sysex.h" -// Allocate space for encoding overhead. -// The header and terminator are not stored to save a few bytes of precious ram -# define MIDI_SYSEX_BUFFER (API_SYSEX_MAX_SIZE + API_SYSEX_MAX_SIZE / 7 + (API_SYSEX_MAX_SIZE % 7 ? 1 : 0)) -#endif diff --git a/tmk_core/protocol/midi/qmk_midi.c b/tmk_core/protocol/midi/qmk_midi.c index c18dbf9930..3a454d61ae 100644 --- a/tmk_core/protocol/midi/qmk_midi.c +++ b/tmk_core/protocol/midi/qmk_midi.c @@ -4,9 +4,6 @@ #include "midi.h" #include "usb_descriptor.h" #include "process_midi.h" -#if API_SYSEX_ENABLE -# include "api_sysex.h" -#endif /******************************************************************************* * MIDI @@ -124,41 +121,6 @@ static void cc_callback(MidiDevice* device, uint8_t chan, uint8_t num, uint8_t v // midi_send_cc(device, (chan + 1) % 16, num, val); } -#ifdef API_SYSEX_ENABLE -uint8_t midi_buffer[MIDI_SYSEX_BUFFER] = {0}; - -static void sysex_callback(MidiDevice* device, uint16_t start, uint8_t length, uint8_t* data) { - // SEND_STRING("\n"); - // send_word(start); - // SEND_STRING(": "); - // Don't store the header - int16_t pos = start - 4; - for (uint8_t place = 0; place < length; place++) { - // send_byte(*data); - if (pos >= 0) { - if (*data == 0xF7) { - // SEND_STRING("\nRD: "); - // for (uint8_t i = 0; i < start + place + 1; i++){ - // send_byte(midi_buffer[i]); - // SEND_STRING(" "); - // } - const unsigned decoded_length = sysex_decoded_length(pos); - uint8_t decoded[API_SYSEX_MAX_SIZE]; - sysex_decode(decoded, midi_buffer, pos); - process_api(decoded_length, decoded); - return; - } else if (pos >= MIDI_SYSEX_BUFFER) { - return; - } - midi_buffer[pos] = *data; - } - // SEND_STRING(" "); - data++; - pos++; - } -} -#endif - void midi_init(void); void setup_midi(void) { @@ -170,7 +132,4 @@ void setup_midi(void) { midi_device_set_pre_input_process_func(&midi_device, usb_get_midi); midi_register_fallthrough_callback(&midi_device, fallthrough_callback); midi_register_cc_callback(&midi_device, cc_callback); -#ifdef API_SYSEX_ENABLE - midi_register_sysex_callback(&midi_device, sysex_callback); -#endif } -- cgit v1.2.3