Code Monkey home page Code Monkey logo

Comments (3)

Rayzeq avatar Rayzeq commented on June 1, 2024

After doing it on my local files, I just realized that it doesn't really work, but I think there should be a way to create an XInputUSB api without modifying the Arduino installation files.

from arduinoxinput.

dmadison avatar dmadison commented on June 1, 2024

As you discovered, the preprocessor checks can't be moved to the header because the .ino and the library .cpp are in two separate compilation units. The preprocessor checks don't carry over.

I agree with you that it would be nice not to have to modify the Arduino installation files but I can't think of a good way to do it. This is mostly a quirk with how the Arduino build system is so rigid. If you want to modify the "makefile" you need to modify the Arduino core. The library and the API are designed to function independent of one another, so the API must be defined elsewhere in the core in order for the library to see it.

If you can think of a clean solution I'd be happy to implement it.

from arduinoxinput.

Rayzeq avatar Rayzeq commented on June 1, 2024

I couldn't find a solution either, so I added #include "MyHeader.h" in XInput.h, it's not a good solution, but it works.

from arduinoxinput.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.