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.

  • 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. – Connor Wolf Mar 18 '14 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. – Cybergibbons Mar 18 '14 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? – Anonymous Penguin Mar 18 '14 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 – portforwardpodcast Mar 30 '15 at 23:18
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, privacy policy and cookie policy

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