-
Notifications
You must be signed in to change notification settings - Fork 7.6k
max() not accepting #defined values #6623
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
Comments
Sorry, Arduino IDE is 1.8.19 |
If you want to ensure it is a float, cast it as a float: |
Thanks for the tip, however I'm already aware of the workarounds. BTW, one should not need to cast a clearly floating point number as float, despite the fact that it works! |
Yes, the authors of gcc do not seem to care much about the "Arduino standard" |
Arduino Standard defines a macro for ESP32 Arduino doesn't define such macro... @palmerr23 - does your sketch behave the same as Arduino Standard if you use |
A workaround for now is to add this code to the first line of your sketch:
I'll verify if we can add a patch to solve it for good. |
Yes, the workaround does work as you describe. It would be useful to have _max() and max() doing the same thing, preferably the same as Arduino "standard". Thanks for your efforts so far on this. |
@palmerr23 - There is no way to add Therefore, the work around proposed is the only way to go. I added a few other functions to |
Thanks for trying! |
Board
DevkitC ESP32 WROOM
Device Description
None
Hardware Configuration
No
Version
latest development Release Candidate (RC-X)
IDE Name
Arduino 1.8.13
Operating System
Win 11
Flash frequency
80MHz
PSRAM enabled
no
Upload speed
921600
Description
Max is not accepting #defined values
The second call to max() fails to compile in ESP32, nut OK in AVR.
Issue occurs in both 2.0.2 and 2.0.3_RC1
Sketch
Debug Message
Other Steps to Reproduce
Nothing else, simple compile issue.
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: