MIDI over USB Arduino Leonardo (TeeOnArdu)

I solved it by comparing all files in the hardware/arduino folder with the ones in the hardware/TeeOnArdu. I suspected that it was a compiler option, and indeed, there was a flag -mmcu={build.mcu} in the platforms.txt file.
Then I noticed that Arduino 1.6 had some new compile patterns, including these two:

## Preprocessor
preproc.includes.flags=-w -x c++ -M -MG -MP
recipe.preproc.includes="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.includes.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}"

preproc.macros.flags=-w -x c++ -E -CC
recipe.preproc.macros="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.macros.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{preprocessed_file_path}"

The TeeOnArdu's platforms.txt file didn't have these recipes, so build.mcu was not passed on to the preprocessor, resulting in AVR_ATmega32U4 being undefined. According to the documentation, it is defined by the compiler, based on the -mmcu option.

I ended up copying the whole Arduino platforms.txt file, just to make sure everything was up to date. After adding some -D options, to set some defines for the menu options specified in boards.txt, I was able to compile and upload blink. Midi still didn't work, so I replaced the entire core by the Arduino core.
Then I enabled verbose output of the compiler, and added the necessary parts from TeeOnArdu, piece by piece, until everything compiled without errors...

It was quite time-consuming, but now both MIDI and Blink compile and upload fine, and I can see the MIDI messages on my computer.

Anyway, thanks for your reply :slight_smile: