Git Product home page Git Product logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 15, 2024
I think this is only possible in the forthcoming Arduino 0017, as currently the 
libraries are pre-built (when a 
board is selected).  This is changing so that the the libraries, core, and 
sketch will all be compiled together, at 
which point the -include could be applied to all of the source files.  I'm 
still not convinced this is needed, but it's 
starting to seem more useful.  What about just something like "config.h" or 
"options.h" instead of 
"wiring_options.h"?  

Original comment by [email protected] on 5 Jun 2009 at 8:23

from arduino.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 15, 2024
My preferred approach to this issue would be to check for the
existence of a specially-named header file in the sketch (e.g.
options.h or config.h) and, if it exists, include it (on the avr-gcc /
avr-g++ command line) while compiling the core and libraries for the
sketch.  This header file could then include any #define's needed to
override their configuration.  It has the advantage of being a
standard header file, something that the IDE already supports the
editing of.  On the other hand, it wouldn't let you change the
arguments passed to the compiler.

I'm still not, however, quite convinced that something like this is
useful enough to include.  In particular, it exposes portions of the
internal implementation of the core and libraries in a way that people
will start to rely on.  If we changed the name of some internal
constant, it would break the config.h files that used it.  Also, we
don't know how much people would start trying to customize or hack the
core and libraries through the use/abuse of macros.  We'd potentially
be encouraging the proliferation of sketches that were very much
dependent on the internals of the core and libraries, and therefore
unlikely to be portable across updates to the software.  I'm not sure
it's worth it just to let people change the size of the serial
buffers.

Original comment by [email protected] on 10 Mar 2011 at 11:50

from arduino.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 15, 2024
Issue 339 has been merged into this issue.

Original comment by [email protected] on 15 Aug 2011 at 8:43

from arduino.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 15, 2024
Another use case for this would be compile-time allocation of timers to various 
functions (e.g. tone() vs. Servo).

Original comment by [email protected] on 16 Aug 2011 at 9:02

  • Changed title: Specially-named header file for providing #defines to the core and library on a per-sketch basis.

from arduino.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 15, 2024
Issue 783 has been merged into this issue.

Original comment by [email protected] on 9 Jan 2012 at 12:45

from arduino.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 15, 2024
Whether including a config.h for the Arduino core parts is useful is debatable. 
However there is currently no way to change the compilation of "libraries" I 
download from elsewhere or make myself, so it's difficult to write generic code 
that is reusable. Making everything be evaluated at run-time is not possible 
(using if statements) is not appropriate with microcontrollers and a few kbyte 
of code space.

This problem needs a solution. Having issues open for years doesn't help.

Original comment by [email protected] on 9 Jan 2012 at 8:56

from arduino.

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.