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

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

Open
ggolfil opened this issue Jul 17, 2024 · 2 comments

Comments

@ggolfil
Copy link

ggolfil commented Jul 17, 2024

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
Copy link
Owner

AlirezaSalehy commented Jul 30, 2024

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!

@rickyelqasem
Copy link

I have similar issues.. I tried to compile libary.ino on a ESP32 Dev module and I get this error:

C:\Users\ricky\Downloads\WAVRecorder-main (1)\WAVRecorder-main\library\src\AudioTimer.cpp: In member function 'void AudioTimer::setup(uint32_t, void ()())':
C:\Users\ricky\Downloads\WAVRecorder-main (1)\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\ricky\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.4\cores\esp32/esp32-hal.h:84,
from C:\Users\ricky\Downloads\WAVRecorder-main (1)\WAVRecorder-main\library\src\AudioTimer.h:5,
from C:\Users\ricky\Downloads\WAVRecorder-main (1)\WAVRecorder-main\library\src\AudioTimer.cpp:1:
C:\Users\ricky\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.4\cores\esp32/esp32-hal-timer.h:35:13: note: declared here
35 | hw_timer_t timerBegin(uint32_t frequency);
| ^~~~~~~~~~
C:\Users\ricky\Downloads\WAVRecorder-main (1)\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\ricky\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.4\cores\esp32/esp32-hal-timer.h:50:6: note: declared here
50 | void timerAttachInterrupt(hw_timer_t *timer, void (*userFunc)(void));
| ^~~~~~~~~~~~~~~~~~~~
C:\Users\ricky\Downloads\WAVRecorder-main (1)\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\ricky\Downloads\WAVRecorder-main (1)\WAVRecorder-main\library\src\AudioTimer.cpp: In member function 'void AudioTimer::start()':
C:\Users\ricky\Downloads\WAVRecorder-main (1)\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\ricky\Downloads\WAVRecorder-main (1)\WAVRecorder-main\library\src\AudioTimer.cpp: In member function 'void AudioTimer::stop()':
C:\Users\ricky\Downloads\WAVRecorder-main (1)\WAVRecorder-main\library\src\AudioTimer.cpp:52:17: error: 'timerAlarmDisable' was not declared in this scope
52 | timerAlarmDisable(timer);
| ^~~~~~~~~~~~~~~~~
Multiple libraries were found for "SD.h"
Used: C:\Users\ricky\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.4\libraries\SD
Not used: C:\Users\ricky\AppData\Local\Arduino15\libraries\SD
exit status 1

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

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

No branches or pull requests

3 participants