Page 1 of 1

How can i use defined(ARDUINO_T-BEAM) when the '-' character is not accepted by compiler?

Posted: Sun Feb 23, 2025 2:06 pm
by serialrf433
Hello. The file boards.txt have many different boards defined. Some of them have a name with a '-' inside like the t-beam. When i write software and want to check the board, i would like to use for example the defined(ARDUINO_T-BEAM). But that is not possible. The compiler does not accept '-' in defined().

Thats how the compiler error looks like:

Code: Select all

error: missing binary operator before token "BEAM"
   42 |   #elif defined(ARDUINO_T-BEAM)
      |                           ^~~~
Could someone tell me how this can be used in such a use case? I searched for some time but was not able to find an answer.

Re: How can i use defined(ARDUINO_T-BEAM) when the '-' character is not accepted by compiler?

Posted: Mon Feb 24, 2025 3:25 am
by lbernstone
It is ARDUINO_TBEAM. You can look through boards.txt for the .board entry, which is what gets appended to ARDUINO_. You can also see this in the variants directory.