Loading...
Pages: [1]   Go Down
Author Topic: Compiler Directive That Sets Tools > Board Selection?  (Read 61 times)
0 Members and 1 Guest are viewing this topic.
Samplefinger
Offline Offline
God Member
*****
Karma: 8
Posts: 819
ALWAYS ASK FOR THREE. One to use. One to lose. One to abuse.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Latest Sampling Scores: ATXMEGA64A3U-MH x3, ATXMEGA256A3U-MH x3, SST38VF6404-90-5C-EKE x3, SST38VF6402-90-5C-EKE x3, PGA870 x3, THS770006 x3

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 96
Posts: 6372
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Pages: [1]   Go Up
Print
 
Jump to: