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

please do not use #define for function names - this bashes every other library #9372

Closed
1 task done
ladyada opened this issue Mar 14, 2024 · 1 comment
Closed
1 task done
Labels
Status: Awaiting triage Issue is waiting for triage

Comments

@ladyada
Copy link
Contributor

ladyada commented Mar 14, 2024

Board

ESP32 family

Device Description

any

Hardware Configuration

n/a

Version

latest master (checkout manually)

IDE Name

Arduino IDE

Operating System

any

Flash frequency

n/a

PSRAM enabled

yes

Upload speed

n/a

Description

It seems that in 3.xx ESP BSP decides to use #define to remap functions like analogWrite() with #define

https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/io_pin_remap.h#L18

however, this means any library that uses a function like analogWrite (say a DAC interface library) or analogRead (from a ADC interface library) will act unusually/incorrectly/may-not-even-compile because the #define is changing the function call invisibly.

https://forums.adafruit.com/viewtopic.php?p=1000372

please please please do not do this!

Sketch

n/a

Debug Message

n/a

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.
@ladyada ladyada added the Status: Awaiting triage Issue is waiting for triage label Mar 14, 2024
@ladyada
Copy link
Contributor Author

ladyada commented Mar 14, 2024

pardon, this is a duplicate of
#9150
(will add comment there)

@ladyada ladyada closed this as completed Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting triage Issue is waiting for triage
Projects
None yet
Development

No branches or pull requests

1 participant