I am following a DIY guide that requires me to patch two arduino core library files: HID.cpp and USBAPI.h. This is not really practical for many reasons. I am not a native C programmer, but I am sure there are better ways to achieve the same without messing directly with system files. How can I override system library files without modifying the originals?

  • That all depends on what the modifications are you need to do...
    – Majenko
    Commented Nov 4, 2015 at 18:05
  • @Majenko principally it adds a third device description (HID Remote) to the two devices that are described in those two files (Keyboard and Mouse). I can upload a diff. Commented Nov 4, 2015 at 18:30
  • Can't you just place a copy in the sketches folder and alter this local copy?
    – Gerben
    Commented Nov 4, 2015 at 19:03

1 Answer 1


Unfortunately there really isn't any way of doing that other than modifying those files. The good news is that it is perfectly viable to make the modifications under a different "core" and then amend boards.txt with the core containing the modifications.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.