Skip to content

Commit

Permalink
Merge pull request #144 from corrados/arduino_esp32_3_0
Browse files Browse the repository at this point in the history
Add support for arduino-esp32 3.0
  • Loading branch information
corrados committed Jun 11, 2024
2 parents 39d5b21 + e2a1c8c commit 193dccd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
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

0 comments on commit 193dccd

Please sign in to comment.