-/*
+/*
* Copyright 2012 Jun Wako <wakojun@gmail.com>
* This file is based on:
* LUFA-120219/Demos/Device/Lowlevel/KeyboardMouse
#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
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