summaryrefslogtreecommitdiff
path: root/quantum/process_keycode/process_midi.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/process_keycode/process_midi.c')
-rw-r--r--quantum/process_keycode/process_midi.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/quantum/process_keycode/process_midi.c b/quantum/process_keycode/process_midi.c
index ce62559849..377fcb69e2 100644
--- a/quantum/process_keycode/process_midi.c
+++ b/quantum/process_keycode/process_midi.c
@@ -15,12 +15,13 @@
*/
#include "process_midi.h"
-#ifdef MIDI_ENABLE
-# include <LUFA/Drivers/USB/USB.h>
-# include "midi.h"
-# include "qmk_midi.h"
+#include <LUFA/Drivers/USB/USB.h>
+#include "midi.h"
+#include "qmk_midi.h"
+#include "timer.h"
+#include "debug.h"
-# ifdef MIDI_BASIC
+#ifdef MIDI_BASIC
void process_midi_basic_noteon(uint8_t note) {
midi_send_noteon(&midi_device, 0, note, 127);
@@ -34,12 +35,9 @@ void process_midi_all_notes_off(void) {
midi_send_cc(&midi_device, 0, 0x7B, 0);
}
-# endif // MIDI_BASIC
-
-# ifdef MIDI_ADVANCED
-
-# include "timer.h"
+#endif // MIDI_BASIC
+#ifdef MIDI_ADVANCED
static uint8_t tone_status[2][MIDI_TONE_COUNT];
static uint8_t midi_modulation;
@@ -248,11 +246,11 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) {
return true;
}
-# endif // MIDI_ADVANCED
+#endif // MIDI_ADVANCED
void midi_task(void) {
midi_device_process(&midi_device);
-# ifdef MIDI_ADVANCED
+#ifdef MIDI_ADVANCED
if (timer_elapsed(midi_modulation_timer) < midi_config.modulation_interval) return;
midi_modulation_timer = timer_read();
@@ -270,7 +268,5 @@ void midi_task(void) {
if (midi_modulation > 127) midi_modulation = 127;
}
-# endif
+#endif
}
-
-#endif // MIDI_ENABLE