Go Down

Topic: Board Settings in *.ino file (Read 4362 times) previous topic - next topic

GeertVc

Well, it's pretty clear by the degree of support that I'm the only one who thinks this would be a good feature to incorporate into the IDE, so it's probably best to just forget that I posted this suggestion.
No, you're not and no, it's not...  I'm having the same question since I also have the very same issue. Trust me, we're not the only ones.

To me, it would be normal and logically if the board could be saved with the .ino file of a project since having different boards laying on your table is really not an exception.

I have different Arduino's, ESP8266 and ATTiny85 boards with which I'm working and each and every time I'm hitting the same stone (must be stupidity, I guess): forgot to change the board and bang... building is OK but uploading is, of course, not...

Hope this will change in the future.

Best,

Geert

technix

Instead of using comments, I think using #pragma might be a better idea. The #pragma's would be picked up by the arduino-build tool and removed from the generated C++ sources. It is also technically backwards compatible since GCC will just ignore the unrecognized #pragmas.

Ideas I have:

Code: [Select]
#pragma arduino board "Arduino/Genuino Uno" // This selects the board in the sketch.
#pragma arduino board "Generic ESP8266" // You do meed to match the board title or identifier exactly though.
#pragma arduino upload programmer // Force uploading with programmer
#pragma arduino upload default // Default upload method.
#pragma arduino define SOME_VARIABLE // Passes -DSOME_VARIABLE to all calls of GCC
#pragma arduino import TFT // Pulls in a library without including its header file. There might be C++ header file collisions in some corner cases, and this alternative syntax can avoid that.
#pragma arduino config board.upload.arguments "-F" // This can even inject board.txt contents.

vaughang91

anyone have any luck with this ?

ThingEngineer

The #pragma idea is an excellent idea technix.

I try to use Atom PlatformIO when possible but I still use Arduino a lot. In PlatformIO all the settings are in an ini file, it's wonderful when you are working on multi-device setups. I would love to see this in the Arduino IDE as well!

Go Up