Jump to content
43oh

Determining Board Selection


Recommended Posts

G'day,

At the moment I change a #define that allows me to use different Libs depending on the board used.

Is there a #define statement that allows this to happen automatically at compile time?

This will allow me to use the same sketch regardless if its for a Tiva  or another launch pad.

 

Link to post
Share on other sites

Hi,

 

you can use the for sure the uC name:

#if defined(__TM4C1294NCPDT__) /*tivac LM4C1294 writes 4 locations at once;*/ 

In older Arduino IDE's I've used the board name as well, but not sure how the newer IDEs work:

 #if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO)

Regards,

Liviu

 

LE Because of the "command line defines" (-D compiling option), I think in the last Energia (1.6.10E18) you can use "ENERGIA_board-name", with the "board-name" found in the boards.txt file. For my TivaC TM41294XL, the boards.txt shows:

EK-TM4C1294XL.build.board=EK-TM4C1294XL

and the compile option is

-DENERGIA_EK-TM4C1294XL
Link to post
Share on other sites

LE Because of the "command line defines" (-D compiling option), I think in the last Energia (1.6.10E18) you can use "ENERGIA_board-name", with the "board-name" found in the boards.txt file. For my TivaC TM41294XL, the boards.txt shows:

EK-TM4C1294XL.build.board=EK-TM4C1294XL

and the compile option is

-DENERGIA_EK-TM4C1294XL

 

In the latest version this has probably changed:

 

https://github.com/energia/tivac-core/blob/master/boards.txt#L35

 

EK_TM4C1294XL

 

-rick

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...