ESP32Talkie icon indicating copy to clipboard operation
ESP32Talkie copied to clipboard

Arduino ESP32 Core v3. breaks several Talkie function calls

Open chache17 opened this issue 1 year ago • 2 comments

I installed the Talkie library, to use in ESP32 devices.

I had the ESP32 Core API v.3.0.2 which removed or modified several functions used by Talkie, as seen in ESP's documentation Migration from 2.x to 3.0

This caused evident compilation errors:

/Users/username/Documents/Arduino/libraries/Talkie/src/Talkie.cpp: In member function 'void Talkie::initializeHardware()':
/Users/username/Documents/Arduino/libraries/Talkie/src/Talkie.cpp:326:44: error: too many arguments to function 'hw_timer_t* timerBegin(uint32_t)'
  326 |         sTalkieSampleRateTimer = timerBegin(1, APB_FREQUENCY_DIVIDER, true);
      |                                  ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/username/Library/Arduino15/packages/esp32/hardware/esp32/3.0.2/cores/esp32/esp32-hal.h:84,
                 from /Users/username/Library/Arduino15/packages/esp32/hardware/esp32/3.0.2/cores/esp32/Arduino.h:36,
                 from /Users/username/Documents/Arduino/libraries/Talkie/src/Talkie.cpp:78:
/Users/username/Library/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);
      |             ^~~~~~~~~~
/Users/username/Documents/Arduino/libraries/Talkie/src/Talkie.cpp:327:29: error: too many arguments to function 'void timerAttachInterrupt(hw_timer_t*, void (*)())'
  327 |         timerAttachInterrupt(sTalkieSampleRateTimer, timerInterrupt, true);
      |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/username/Library/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));
      |      ^~~~~~~~~~~~~~~~~~~~
/Users/username/Documents/Arduino/libraries/Talkie/src/Talkie.cpp:328:9: error: 'timerAlarmWrite' was not declared in this scope; did you mean 'timerWrite'?
  328 |         timerAlarmWrite(sTalkieSampleRateTimer, (getApbFrequency() / APB_FREQUENCY_DIVIDER) / SAMPLE_RATE, true);
      |         ^~~~~~~~~~~~~~~
      |         timerWrite
/Users/username/Documents/Arduino/libraries/Talkie/src/Talkie.cpp:330:5: error: 'timerAlarmEnable' was not declared in this scope; did you mean 'timerAlarm'?
  330 |     timerAlarmEnable(sTalkieSampleRateTimer);
      |     ^~~~~~~~~~~~~~~~
      |     timerAlarm
/Users/username/Documents/Arduino/libraries/Talkie/src/Talkie.cpp: In member function 'void Talkie::terminateHardware()':
/Users/username/Documents/Arduino/libraries/Talkie/src/Talkie.cpp:449:9: error: 'timerAlarmDisable' was not declared in this scope
  449 |         timerAlarmDisable(sTalkieSampleRateTimer);
      |         ^~~~~~~~~~~~~~~~~

exit status 1

Compilation error: exit status 1

After downgrading to ESP32 Core version 2.0.17, Talkie samples started compiling successfully.

It would be great to have compatibility with the newer ESP32 Core API, if possible.

chache17 avatar Jul 01 '24 23:07 chache17

Hi

Did this ever get resolved, as I am having same issue.

Galaxy-Man avatar Sep 13 '24 16:09 Galaxy-Man

hi @Galaxy-Man a fix was committed a couple days ago in this repository Talkie by ArminJo. I haven't had the chance to look into it yet, but hope to do so during this weekend :-)

chache17 avatar Sep 21 '24 04:09 chache17