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

Bug in release 2.3.8: extra tokens at end of #undef directive #133

Open
pixelfriese opened this issue Dec 13, 2023 · 4 comments · May be fixed by #135
Open

Bug in release 2.3.8: extra tokens at end of #undef directive #133

pixelfriese opened this issue Dec 13, 2023 · 4 comments · May be fixed by #135

Comments

@pixelfriese
Copy link

pixelfriese commented Dec 13, 2023

Description

Since the new version 2.3.8, error messages are displayed during the build process. No error messages appear in version 2.3.7.

Steps To Reproduce Problem

The error occurs directly in the build process of the library. Platformio is used with an ESP32 DevKit V1. OneWire is used as a dependency for the milesburton/DallasTemperature @ 3.11.0 library.

Hardware & Software

Board ESP32 DevKitV1
Shields / modules used no
Arduino IDE version PlatformIO 6.1.11
Teensyduino version (if using Teensy) no
Version info & package name (from Tools > Boards > Board Manager) paulstoffregen/OneWire @ 2.3.8
Operating system & version Windows 11
Any other software or hardware? no

Arduino Sketch

OneWire\OneWire.cpp

// undef defines for no particular reason
#ifdef ARDUINO_ARCH_ESP32
#  undef noInterrupts() {portMUX_TYPE mux = portMUX_INITIALIZER_UNLOCKED;portENTER_CRITICAL(&mux)
#  undef interrupts() portEXIT_CRITICAL(&mux);}
#endif
// for info on this, search "IRAM_ATTR" at https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/general-notes.html 
#undef CRIT_TIMING 

Errors or Incorrect Output

.pio/libdeps/myproject/OneWire/OneWire.cpp:599:22: warning: extra tokens at end of #undef directive
 #  undef noInterrupts() {portMUX_TYPE mux = portMUX_INITIALIZER_UNLOCKED;portENTER_CRITICAL(&mux)
                      ^
.pio/libdeps/myproject/OneWire/OneWire.cpp:600:20: warning: extra tokens at end of #undef directive
 #  undef interrupts() portEXIT_CRITICAL(&mux);}
@Finnitio
Copy link

That happens to me too when building. I use a a esp32doit-devkit-v1 board. I use Platformio 3.3.2 with vscode. Going back to version 2.3.7 fixed the issue. Interestingly on another machine with vscode and platformio 3.3.2 the error does not occur.

@Nik-mayak
Copy link

Nik-mayak commented Jan 22, 2024

The problem is solved like this: after # undef noInterrupts and # undef Interrupts nothing else is needed in file OneWire.cpp.
#ifdef ARDUINO_ARCH_ESP32
#undef noInterrupts // () {portMUX_TYPE mux = portMUX_INITIALIZER_UNLOCKED;portENTER_CRITICAL(&mux)
#undef interrupts // () portEXIT_CRITICAL(&mux);}
#endif

@LoQue90
Copy link

LoQue90 commented Feb 28, 2024

@Nik-mayak are you going to open a PR on this?

mathieucarbou added a commit to mathieucarbou/PaulStoffregen-OneWire that referenced this issue Mar 17, 2024
@mathieucarbou mathieucarbou linked a pull request Mar 17, 2024 that will close this issue
@mathieucarbou
Copy link

@PaulStoffregen : would it be possible to merge this PR and issue a new release and deploy in platformio registry ?
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants