AlirezaSalehy / WAVRecorder

Arduino Library for voice recording using Electret Microphones for ESP32, ESP8266 and Arduino Due.
28 stars 1 forks source link

Compilation error: too many arguments to function 'hw_timer_t* timerBegin(uint32_t)' #9

Open ggolfil opened 2 months ago

ggolfil commented 2 months ago

hello, I ran the library.ino code and the compiler gave me this error, can you help?

C:\Users\User\Desktop\WAVRecorder-main\library\src\AudioTimer.cpp: In member function 'void AudioTimer::setup(uint32_t, void ()())': C:\Users\User\Desktop\WAVRecorder-main\library\src\AudioTimer.cpp:17:27: error: too many arguments to function 'hw_timer_t timerBegin(uint32_t)' 17 | timer = timerBegin(0, 20, true); | ~~^~~~~ In file included from C:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.2\cores\esp32/esp32-hal.h:84, from C:\Users\User\Desktop\WAVRecorder-main\library\src\AudioTimer.h:5, from C:\Users\User\Desktop\WAVRecorder-main\library\src\AudioTimer.cpp:1: C:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.2\cores\esp32/esp32-hal-timer.h:35:13: note: declared here 35 | hw_timer_t timerBegin(uint32_t frequency); | ^~~~~~ C:\Users\User\Desktop\WAVRecorder-main\library\src\AudioTimer.cpp:18:29: error: too many arguments to function 'void timerAttachInterrupt(hw_timer_t, void ()())' 18 | timerAttachInterrupt(timer, f, true); | ~~~~^~~~ C:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.2\cores\esp32/esp32-hal-timer.h:50:6: note: declared here 50 | void timerAttachInterrupt(hw_timer_t timer, void (*userFunc)(void)); | ^~~~~~~~ C:\Users\User\Desktop\WAVRecorder-main\library\src\AudioTimer.cpp:19:9: error: 'timerAlarmWrite' was not declared in this scope; did you mean 'timerWrite'? 19 | timerAlarmWrite(timer, 4000000 / frequency, true); // 500 for 8Khz, 250 for 16Khz, 125 for 32Khz | ^~~~~~~ | timerWrite C:\Users\User\Desktop\WAVRecorder-main\library\src\AudioTimer.cpp: In member function 'void AudioTimer::start()': C:\Users\User\Desktop\WAVRecorder-main\library\src\AudioTimer.cpp:37:9: error: 'timerAlarmEnable' was not declared in this scope; did you mean 'timerAlarm'? 37 | timerAlarmEnable(timer); | ^~~~ | timerAlarm C:\Users\User\Desktop\WAVRecorder-main\library\src\AudioTimer.cpp: In member function 'void AudioTimer::stop()': C:\Users\User\Desktop\WAVRecorder-main\library\src\AudioTimer.cpp:52:17: error: 'timerAlarmDisable' was not declared in this scope 52 | timerAlarmDisable(timer); | ^~~~~

exit status 1

Compilation error: too many arguments to function 'hw_timer_t* timerBegin(uint32_t)'

AlirezaSalehy commented 1 month ago

Hello!

In the original use case library.ino file gets compiled without any error, and i double checked it. So, i can't figure out the problem, in your case some misused according to the library's APIs may have happened.

Regards!