Go Down

Topic: the -DARDUINO=<version> define when using avr-gcc (Read 2483 times) previous topic - next topic

derbroti

Feb 06, 2017, 12:40 pm Last Edit: Feb 06, 2017, 12:49 pm by derbroti
Hi,

I am using a makefile with avr-gcc to compile an Arduino project (the ultimaker marlin firmware).

My question: there is the ARDUNIO=<version> define used when calling avr-gcc - how important is it to set it to the correct Arduino IDE version that is used?

Is this define evaluated internally somewhere? or is it just a if version > 100 then to this, otherwise do that?

-> Reason for asking, there is a fork of said firmware which apparently behaves strange and I want to find out if it has something to do with the fact that the developer do not specify the ardiuno version "correctly" - as in they have it set to 165 despite using a different (newer) version of the Arduino framework/IDE.

Thanks! Oh this might not be the best section to ask this question - sorry :( probably "Installation & Troubleshooting"?!

PaulS

Quote
how important is it to set it to the correct Arduino IDE version that is used?
Does any of the code being compiled care? Most code does not.
The art of getting good answers lies in asking good questions.

derbroti

The code of the firmware itself: no,
but does the Arduino core code care?

pert

It's not used anywhere in the Arduino AVR Boards core. It is used in the following libraries:
Adafruit_CircuitPlayground
Firmata
RobotIRremote
Robot_Control
Robot_Motor
Temboo
TFT

It's possible it's used in some of the 3rd party libraries that Marlin uses. The most common usage is:
Code: [Select]
#if defined(ARDUINO) && ARDUINO >= 100
#include <Arduino.h>
#else
#include <WProgram.h>
#endif

which would just cause compilation to fail because WProgram.h doesn't exist in any IDE version from 1.0.0 onward but that's not to say some library might not use it in a another way.

derbroti


Go Up