bobh / ESP32Talkie

116 stars 9 forks source link

Arduino ESP32 Core v3. breaks several Talkie function calls #3

Open chache17 opened 4 months ago

chache17 commented 4 months ago

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.

Galaxy-Man commented 2 months ago

Hi

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

chache17 commented 2 months ago

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 :-)