Go Down

Topic: Compiler Directive That Sets Tools > Board Selection? (Read 654 times) previous topic - next topic


I've done a few projects on alternate Atmel Tiny and Mega microcontrollers using the Arduino IDE.  One thing that is annoying is having to remember to switch the board target before compiling, otherwise you just get unworking code.  It would be nice if there was a way to override this selection in the sketch itself.  Does anyone know if there is a compiler directive for this?  Thanks.
I will never ask you to do anything that I wouldn't do myself.


The IDE uses the 'core' and 'variant' setting in boards.txt to pick the right core libraries to compile and link with your sketch. 

Maybe could put directives in your sketch to cause a compile-time error if you try to compile for the wrong processor type.

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131