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

Add support for arduino-esp32 3.0 #144

Merged
merged 5 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions edrumulus_hardware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,21 +305,23 @@ void Edrumulus_hardware::setup ( const int conf_Fs,

// create task pinned to core 0 for creating the timer interrupt so that the
// timer function is not running in our working core 1
#ifdef CONFIG_IDF_TARGET_ESP32
xTaskCreatePinnedToCore ( start_timer_core0_task, "start_timer_core0_task", 800, this, 1, NULL, 0 );
#else // CONFIG_IDF_TARGET_ESP32S3
xTaskCreatePinnedToCore ( start_timer_core0_task, "start_timer_core0_task", 1000, this, 1, NULL, 0 );
#endif
}


void Edrumulus_hardware::setup_timer()
{
// prepare timer at a rate of given sampling rate
#if ESP_IDF_VERSION_MAJOR < 5
timer = timerBegin ( 0, 80, true ); // prescaler of 80 (i.e. below we have 1 MHz instead of 80 MHz)
timerAttachInterrupt ( timer, &on_timer, true );
timerAlarmWrite ( timer, 1000000 / Fs, true ); // here we define the sampling rate (1 MHz / Fs)
timerAlarmEnable ( timer );
#else
timer = timerBegin ( 1000000 );
timerAttachInterrupt ( timer, &on_timer );
timerAlarm ( timer, 1000000 / Fs, true, 0 );
#endif
}


Expand Down
9 changes: 9 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,12 @@ lib_archive = no
lib_deps =
fortyseveneffects/MIDI Library
adafruit/Adafruit TinyUSB Library

; see https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#how-to-update-to-the-latest-code
[env:arduino-latest]
platform = https://github.com/sgryphon/platform-espressif32.git#sgryphon/add-esp32-arduino-libs
board = az-delivery-devkit-v4
framework = arduino
platform_packages =
platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#master
platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-libs.git#idf-release/v5.1
Loading