evert-arias / EasyBuzzer

The Beep Library For Arduino
https://evert-arias.github.io/EasyBuzzer
MIT License
84 stars 22 forks source link

[Request BugFix] error: no matching function for call to 'max(int, const unsigned int&)' #5

Closed LuckyLuzz closed 5 years ago

LuckyLuzz commented 5 years ago

Hey, recently the ESP32 Core for Arduino has been updated and now it is not possible to Build the Library.

The compiler error message is:

C:\Users\XXX.platformio\lib\EasyBuzzer_ID1883\src\EasyBuzzer.cpp: In member function 'void EasyBuzzerClass::beep(unsigned int, unsigned int, unsigned int, byte, unsigned int, unsigned int)':
C:\Users\XXX\.platformio\lib\EasyBuzzer_ID1883\src\EasyBuzzer.cpp:33:61: error: no matching function for call to 'max(int, const unsigned int&)'
mOnDuration = onDuration ? max(MINIMUM_INTERVAL, onDuration) : 0;
^

Environment: Win10, VS Code (V1.30.2) PlattformIO (V3.6.3) Plattform Espressif 32(V1.6.0) with ESP-IDF 3.1.2

evert-arias commented 5 years ago

@shoteff Hi, I already found a solution to this issue and I will be updating the code as soon as possible. Thanks for reporting the issue.

evert-arias commented 5 years ago

This issue has been solved. https://github.com/evert-arias/EasyBuzzer/commit/58ab24d117a0bfc5565b6a463f4f62aac77cbc4e

evert-arias commented 5 years ago

This issue is consider to be solved

pathnirvana commented 1 year ago

there are still many missing max function errors in other boards. I am using a stm32 board

pathnirvana commented 1 year ago

fixed by adding #define MAX(X, Y) (((X) < (Y)) ? (Y) : (X))