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

serialrf433
Posts: 1
Joined: Sun Feb 23, 2025 2:03 pm

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

Postby serialrf433 » Sun Feb 23, 2025 2:06 pm

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.

lbernstone
Posts: 1132
Joined: Mon Jul 22, 2019 3:20 pm

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

Postby lbernstone » Mon Feb 24, 2025 3:25 am

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.

Who is online

Users browsing this forum: No registered users and 2 guests