WeekendWarrior1 / XTronical_XT_DAC_Audio_Mirror

Mirror of XTronical's excellent XT_DAC_Audio library for ease of integration into platformio projects
GNU General Public License v3.0
10 stars 17 forks source link

Compilation error with ESP32 #9

Open walking opened 5 months ago

walking commented 5 months ago

Hi! I'm getting this error when I try to compile. I think it's related to some updates in different libraries...

I'm using ESP32 DEVKITV1

/Users/user/Documents/Arduino/libraries/XT_DAC_Audio/XT_DAC_Audio.cpp: In constructor 'XT_DAC_Audio_Class::XT_DAC_Audio_Class(uint8_t, uint8_t, uint16_t)':
/Users/user/Documents/Arduino/libraries/XT_DAC_Audio/XT_DAC_Audio.cpp:305:27: error: too many arguments to function 'hw_timer_t* timerBegin(uint32_t)'
  305 |         timer = timerBegin(TimerNo, 80, true);           // use timer TimerNo, pre-scaler is 80 (divide by 8000), count up
      |                 ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /Users/user/Documents/Arduino/libraries/XT_DAC_Audio/XT_DAC_Audio.cpp:24:
/Users/user/Library/Arduino15/packages/esp32/hardware/esp32/3.0.0/cores/esp32/esp32-hal-timer.h:35:13: note: declared here
   35 | hw_timer_t *timerBegin(uint32_t frequency);
      |             ^~~~~~~~~~
/Users/user/Documents/Arduino/libraries/XT_DAC_Audio/XT_DAC_Audio.cpp:306:29: error: too many arguments to function 'void timerAttachInterrupt(hw_timer_t*, void (*)())'
  306 |         timerAttachInterrupt(timer, &onTimer, true); // P3= edge triggered
      |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/Users/user/Library/Arduino15/packages/esp32/hardware/esp32/3.0.0/cores/esp32/esp32-hal-timer.h:50:6: note: declared here
   50 | void timerAttachInterrupt(hw_timer_t *timer, void (*userFunc)(void));
      |      ^~~~~~~~~~~~~~~~~~~~
/Users/user/Documents/Arduino/libraries/XT_DAC_Audio/XT_DAC_Audio.cpp:307:9: error: 'timerAlarmWrite' was not declared in this scope; did you mean 'timerWrite'?
  307 |         timerAlarmWrite(timer, 20, true);                        // will trigger 250,000 times per second,
      |         ^~~~~~~~~~~~~~~
      |         timerWrite
/Users/user/Documents/Arduino/libraries/XT_DAC_Audio/XT_DAC_Audio.cpp:308:9: error: 'timerAlarmEnable' was not declared in this scope; did you mean 'timerAlarm'?
  308 |         timerAlarmEnable(timer);                                         // enable
      |         ^~~~~~~~~~~~~~~~
      |         timerAlarm

exit status 1

Compilation error: exit status 1
walking commented 5 months ago

the issue happens with esp32 v3.0.0. Works good with v2.0.17

patrick-kiwi commented 4 months ago

I had similar issues. I had to downgrade to v2.0,17 AND add this include line.

include "soc/rtc_io_reg.h"

my setup Arduino IDE version 1.8.19, esp32 Devkit V1 compiling for the ESP32 Dev Module ESP32 by espressif v2.0.17 on boards manager