Comments (6)
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.
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.
Issue 339 has been merged into this issue.
Original comment by [email protected]
on 15 Aug 2011 at 8:43
from arduino.
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.
Issue 783 has been merged into this issue.
Original comment by [email protected]
on 9 Jan 2012 at 12:45
from arduino.
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)
- Arduino test suites not working on arduino-1.0-beta2 HOT 2
- Arduino IDE 1.0 beta Release Candidate does not support Mega ADK HOT 2
- Split avrdude and avrdude.conf out from massive tools .zip file.
- Stream parseInt() and parseFloat() functions swallow the initial trailing (non-numeric) character. HOT 3
- HardwareSerial is always linked, even if it's not used. HOT 1
- serialEvent easier-to-understand model HOT 3
- Add print(int8_t) and println(int8_t) to format ASCII digits as with uint8_t. HOT 3
- RX and TX defines for specifying which pins are used for Serial / communication with computer. HOT 2
- PIN13 in conflict: SPI SCLK vs. LED HOT 1
- Stream parseInt() and parseFloat() functions should have an option to not search ahead. HOT 1
- Merge PWMServo library (hardware servo control on pins 9 and 10) into Servo library.
- Use hardware PWM if generating a single tone() on the right pin for the timer.
- Please sync Firmata (r82), hopefully for 1.0-beta4 HOT 3
- Rename .pde files to .ino on save, not open. HOT 4
- Incorporate latest changes to the Ethernet library. HOT 1
- Sketch .c, .cpp, and .h files not searched for library includes. HOT 4
- HardwareSerial overflow of input detection
- Compile faster - only recompile files that have changed HOT 18
- Read-only sketch files are renamed from .pde to .ino when saving a copy of the sketch. HOT 2
- SoftwareSerial keywords.txt still says NewSoftSerial
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduino.