Removing CDC class from 32u4-based HID device?

Could someone give me some pointers for the most straightforward way to remove the CDC class so only HID shows up? I realize I’ll have to use the reset button for programming, which is fine. I’m trying to make a class-compliant MIDI device using the MIDIUSB library. I’ve found some older instructions for modifying the core files, but the files seem to be different in the newer versions of the IDE.


Post a link to the instructions. Someone may be abe to help you adapt them to the modern core version. Please use the chain link icon on the toolbar to make it the link clickable.

I ended up finding a solution here:

Copying USBCore.h, USBCore.cpp, and USBDesc.h to the sketch folder will remove the CDC class. This is great, and should be useful for anyone else trying to make a class-compliant device. It should be noted, as in my initial post, that after doing this you have to double-click reset to upload future sketches, and the device can no longer communicate with the serial monitor. However, because the above files get loaded in the IDE with the sketch (because they are in the sketch folder), you can easily turn CDC back on by commenting out this line in each of the three files: