8

I've noticed some irritating differences between the Arduino IDE and Stino (mainly around including certain header files). These are likely bugs that need following up with one or both of the parties, but in the meantime, I would like my code to compile with both of them without editing. This is because I do not want to lock any users out of using my code.

Are there any macros or similar that are readily available (as in, require no modification of the toolchain or IDE) that would allow me to detect which is in use?

For example, in many libraries, there is this snippet:

#if ARDUINO >= 100
  #include "Arduino.h"
#else
  #include "WProgram.h"
#endif

However both Stino and Arduino define this.

4
  • 1
    I've poked around in the Stino toolchain a fair bit, and submitted a pull request or two. It should be pretty easy to get something like #define STINO_COMPILER added to the compilation-time defines. The guy who manages the repo is quite open to sensible pull-requests like that, and once it's properly in the mainline repo, it wouldn't require changes for any of the end-users. Mar 18, 2014 at 1:00
  • Thanks Fake Name - yes, I think that sounds like a good plan. I think I only need support for Stino really. I've not seen Eclipse used often enough to care. Mar 18, 2014 at 8:27
  • This isn't a real solution but you could also add two versions of the code or somehow have a comment: Uncomment the following lines and delete the other lines for Stino. | @Fake Would that be a problem when using that code with the Arduino IDE? Mar 18, 2014 at 23:16
  • To further Anonymous Penguin's comment, you could have a pound define per compiler. And then the default version of the code has an error and will not run unless the user comments a line to specify which compiler they are using. Something like this #if !defined(STINO_COMPILER) #error please uncomment one of the compiler lines #endif
    – benathon
    Mar 30, 2015 at 23:18

1 Answer 1

1

As Stino claims to use the installed Arduino IDE you already have, which means you can not differentiate at compile time.

Your Answer

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

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