You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ttgo-lora32-v1 (and on all boards with a dash in the name)
Device Description
Plain module. This issue is not related to a specific device.
Hardware Configuration
This issue is not related to a specific configuration
Version
latest master (checkout manually)
IDE Name
VS Code
Operating System
macOS 13.0.1
Flash frequency
40 Mhz
PSRAM enabled
no
Upload speed
115200
Description
This problem occurs when arduino-esp32 is used as a component in esp-idf (as described here) and when the name of the board (the "variant") contains a dash (for example ttgo-lora32-v1).
In this case, the CMakeList.txt of arduino-esp32 defines the symbol ARDUINO_${idf_target_caps}_DEV where idf_target_caps is the capitalized board name (or the variant).
When the board name contains a dash (-), the symbol is not valid and the compiler issues plenty of warnings :
<command-line>: warning: ISO C++11 requires whitespace after the macro name
If, inside the C++ code, you want to use conditional compilation, such as :
#ifdef ARDUINO_TTGO-LORA32-V1_DEV
...
#endif
the code still compiles, but it seems to ignore everything starting from the first dash. So it is not possible to distinguish ARDUINO_TTGO-LORA32-V1_DEV from ARDUINO_TTGO-LORA32-V2_DEV. Note that the compiler also issues a warning:
main/main.cpp:3:20: warning: extra tokens at end of #ifdef directive
#ifdef ARDUINO_TTGO-LORA32-V1_DEV
^
and the clang-format adds spaces around the dashes.
So to my opinion, the dashes should be replaced by underscores for the macro defined by the CMakeList.txt. Something like this:
The error messages (warnings) are given in the description.
This warning comes from the command line because of the `-DARDUINO_TTGO-LORA32-V1_DEV` flag :
<command-line>: warning: ISO C++11 requires whitespace after the macro name
This warning comes when you try to test for the symbol:
main/main.cpp:3:20: warning: extra tokens at end of #ifdef directive
#ifdef ARDUINO_TTGO-LORA32-V1_DEV
^
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
I confirm I have checked existing issues, online documentation and Troubleshooting guide.
The text was updated successfully, but these errors were encountered:
Board
ttgo-lora32-v1 (and on all boards with a dash in the name)
Device Description
Plain module. This issue is not related to a specific device.
Hardware Configuration
This issue is not related to a specific configuration
Version
latest master (checkout manually)
IDE Name
VS Code
Operating System
macOS 13.0.1
Flash frequency
40 Mhz
PSRAM enabled
no
Upload speed
115200
Description
This problem occurs when arduino-esp32 is used as a component in esp-idf (as described here) and when the name of the board (the "variant") contains a dash (for example ttgo-lora32-v1).
In this case, the CMakeList.txt of arduino-esp32 defines the symbol
ARDUINO_${idf_target_caps}_DEV
whereidf_target_caps
is the capitalized board name (or the variant).When the board name contains a dash (-), the symbol is not valid and the compiler issues plenty of warnings :
If, inside the C++ code, you want to use conditional compilation, such as :
the code still compiles, but it seems to ignore everything starting from the first dash. So it is not possible to distinguish
ARDUINO_TTGO-LORA32-V1_DEV
fromARDUINO_TTGO-LORA32-V2_DEV
. Note that the compiler also issues a warning:and the clang-format adds spaces around the dashes.
So to my opinion, the dashes should be replaced by underscores for the macro defined by the CMakeList.txt. Something like this:
... but this is already part of the solution and I will provide a Pull Request for this.
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: