I am trying to compile some C code for the ESP32-S3-DevKitC-1 using timers in VS Code. I am trying to use the new(?) hardware/timer code in version 3 of the Arduino ESP32 extension, but my VS Code seems to be using version 2 as evidenced by this compiler error:
src/main.cpp:41:44: error: too few arguments to function 'hw_timer_t* timerBegin(uint8_t, uint16_t, bool)'
In version 2, the function signature for timerBegin
is 'hw_timer_t* timerBegin(uint8_t, uint16_t, bool)
, but in version 3 the signature is
'hw_timer_t* timerBegin(uint32_t)'
, which is the version I need to use. arduino-esp32 migration guide
I am not sure how to upgrade my VS code IDE to use the new APIs.I have tried Configure ESP-IDF Extension
and Add Arduino ESP32 as ESP-IDF Comnponwent
IDE, and I am at ESP-IDF v 1.9.1, ESP v 5.3.1, but I can't seem to find a way to upgrade the Arduino ESP32 bit.
SOLUTION
From PlatformIO Community:
The updated PioArduino platform provides Arduino-ESP32 3.x (and accompanying ESP-IDF) integration to PlatformIO. You essentially only have to change the platform = ...
line in your platformio.ini
. The project’s README
file will tell you exactly how.