I'm trying to use modified USBAPI.h and HID.cpp files by putting them in the sketch folder and add in my sketch #include "USBAPI.h" #include "HID.cpp"
Shouldn't these be given preference to the files in the core library? When I try to verify it appears that somewhere in the tangle of core library #include's it is referencing the file of the same name but still in the core library rather then using my modified ones.
I tried renaming and adding a #define in my sketch, and then add define guards in the 5 core library files that had includes for USBAPI.h. Didn't work.
I think the problem is that Arduino.h and its #include tree gets tacked on before my sketch's #includes and #defines so I lose the race right off the bat.
Anyway around this besides defining a new board for every version of USB output I want to do?
Maybe you can add the files into separate tabbed edit windows in the IDE editor. I sometimes write functions and paste them into IDE tabbed edit windows and they will be included in the main compilation without having to use an #include statement in the main sketch. Note sure on the rules to use .h and .cpp files in the tabbed edit window(s) and how to include them in the main sketch, but I suspect someone around here does. Anyway such added 'files' get stored in the users sketch directory along with the main sketch all automatically.