]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - tmk_core/protocol/lufa/lufa.h
Final HS60v2 changes. (#4790)
[qmk_firmware.git] / tmk_core / protocol / lufa / lufa.h
index b11854101d4e35dc95294106a02f182923724256..7364cdf7ceb3ad10fc99e721632acf7dea423dbf 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright 2012 Jun Wako <wakojun@gmail.com>
  * This file is based on:
  *     LUFA-120219/Demos/Device/Lowlevel/KeyboardMouse
@@ -48,9 +48,6 @@
 #include <LUFA/Version.h>
 #include <LUFA/Drivers/USB/USB.h>
 #include "host.h"
-#ifdef MIDI_ENABLE
-  #include "midi.h"
-#endif
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -67,18 +64,15 @@ typedef struct {
     uint16_t usage;
 } __attribute__ ((packed)) report_extra_t;
 
-#ifdef MIDI_ENABLE
-  void MIDI_Task(void);
-  MidiDevice midi_device;
-  #define MIDI_SYSEX_BUFFER 32 
-#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
 
 // #if LUFA_VERSION_INTEGER < 0x120730