]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - tmk_core/protocol/lufa/lufa.h
ergodox qwerty_code_friendly: add macro keys (#1918)
[qmk_firmware.git] / tmk_core / protocol / lufa / lufa.h
index 195123c0f974f55a534ce716769e4358c0129554..a515737862df0f7c429c6e1a9d3a08354de75d86 100644 (file)
@@ -48,8 +48,9 @@
 #include <LUFA/Version.h>
 #include <LUFA/Drivers/USB/USB.h>
 #include "host.h"
-
-
+#ifdef MIDI_ENABLE
+  #include "process_midi.h"
+#endif
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -66,15 +67,30 @@ typedef struct {
     uint16_t usage;
 } __attribute__ ((packed)) report_extra_t;
 
+#ifdef MIDI_ENABLE
+  void MIDI_Task(void);
+  MidiDevice midi_device;
+#endif
 
-#if LUFA_VERSION_INTEGER < 0x120730
-    /* old API 120219 */
-    #define ENDPOINT_CONFIG(epnum, eptype, epdir, epsize, epbank)    Endpoint_ConfigureEndpoint(epnum, eptype, epdir, epsize, epbank)
-#else
+#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
+
+// #if LUFA_VERSION_INTEGER < 0x120730
+//     /* old API 120219 */
+//     #define ENDPOINT_CONFIG(epnum, eptype, epdir, epsize, epbank)    Endpoint_ConfigureEndpoint(epnum, eptype, epdir, epsize, epbank)
+// #else
     /* new API >= 120730 */
     #define ENDPOINT_BANK_SINGLE 1
     #define ENDPOINT_BANK_DOUBLE 2
     #define ENDPOINT_CONFIG(epnum, eptype, epdir, epsize, epbank)    Endpoint_ConfigureEndpoint((epdir) | (epnum) , eptype, epsize, epbank)
-#endif
+// #endif
 
 #endif