Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some board files use '-' (dash) in macro names, but it is not a valid character for a macro name #81

Closed
prices opened this issue Apr 20, 2018 · 4 comments
Labels
Milestone

Comments

@prices
Copy link
Contributor

prices commented Apr 20, 2018

There are a number of board files that set a macro with '-' in the macro name. It causes this warning:

:0:14: warning: ISO C++11 requires whitespace after the macro name

If you actually try to use the macro in a program, for instance:

#ifdef ARDUINO_ESP32-EVB
// Stuff here
#endif

It causes a further warning:

src/main.cpp:5:21: warning: extra tokens at end of #ifdef directive

The board files that are affected are:

esp32-evb.json: "extra_flags": "-DARDUINO_ESP32-EVB",
esp32-gateway.json: "extra_flags": "-DARDUINO_ESP32-GATEWAY",
esp32vn-iot-uno.json: "extra_flags": "-DARDUINO_esp32vn-iot-uno",
m5stack-core-esp32.json: "extra_flags": "-DARDUINO_M5Stack-Core-ESP32",
nodemcu-32s.json: "extra_flags": "-DARDUINO_NodeMCU-32S",

I will create a pull request changing the '-' (dash) to '_' (underscore). If that is not the solution you want, please let me know and I will change it.

@ivankravets
Copy link
Member

Resolved in #82

@hongquan
Copy link

hongquan commented Jun 13, 2018

There is problem, which seems to be caused by this fix:

I'm using "esp32vn-iot-uno" board, now PlatformIO fails to build my code, with this error:

/home/quan/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:188:26: fatal error: pins_arduino.h: No such file or directory

Looking into the generated C compiler command:

xtensa-esp32-elf-gcc ... -DARDUINO_esp32vn_iot_uno ... -I/home/quan/.platformio/packages/framework-arduinoespressif32/variants/esp32vn_iot_uno

I notice that the included path is wrong:

/home/quan/.platformio/packages/framework-arduinoespressif32/variants/esp32vn_iot_uno

while it should be

/home/quan/.platformio/packages/framework-arduinoespressif32/variants/esp32vn-iot-uno

My workaround is to create a symlink "esp32vn_iot_uno -> esp32vn-iot-uno".

@ivankravets
Copy link
Member

@hongquan
Copy link

Thanks, @ivankravets . It works!

ivankravets added a commit that referenced this issue Jul 2, 2018
* develop:
  Bump version to 1.1.0
  Fix SPIFFS uploading via OTA
  Update Arduino Core to the latest upstream version
  New board "ODROID-GO"
  Set default upload speed to 921600
  Fix maximum allowed data size for ESP32
  Update board flash size
  Update ESP-IDF to 3.0.1 // Resolve #97
  Update default debug initial commands
  Update esptool to 2.4.1
  Set monitor speed to 115200 by default
  Add new Olimex debug tools: ARM-USB-OCD and ARM-USB-TINY
  Minor changes
  Fix broken variant for ESP32vn IoT Uno // Issue #81
  Restore formatting
  Test project with space
  Bump version to 1.0.2

# Conflicts:
#	platform.json
treibholz added a commit to treibholz/platform-espressif32 that referenced this issue Nov 25, 2020
Replace '-' in macro name with '_' for board "TTGO T-Watch"

Fixes compiler warnings:

    <command-line>:0:10: warning: ISO C++11 requires whitespace after the macro name

This is similar to platformio#81
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants