Add support for latest arduino esp32 board library version 2.0.2
This commit is contained in:
@@ -4,6 +4,12 @@ ESP32 Audio Kit based multitrack looper
|
||||
- video presentation of the initial state of this project https://youtu.be/PKQmOsJ-g1I
|
||||
- little quick start guide to get started with arduino synthesizer / music projects: https://youtu.be/ZNxGCB-d68g
|
||||
|
||||
Supported versions of board library
|
||||
---
|
||||
- ESP32 version 1.0.6 from https://github.com/espressif/arduino-esp32/releases/tag/1.0.6
|
||||
- ESP32 version 2.0.2 from https://github.com/espressif/arduino-esp32/releases/tag/2.0.2
|
||||
Please be aware that other versions might be not supported.
|
||||
|
||||
The project has been tested on the ESP32 Audio Kit V2.2
|
||||
|
||||
Useful documents:
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
*/
|
||||
|
||||
|
||||
/* requires the ML_SynthTools library: https://github.com/marcel-licence/ML_SynthTools */
|
||||
#include <ml_delay.h>
|
||||
#ifdef REVERB_ENABLED
|
||||
#include <ml_reverb.h>
|
||||
@@ -140,6 +141,15 @@ void setup()
|
||||
Serial.printf("Total PSRAM: %d\n", ESP.getPsramSize());
|
||||
Serial.printf("Free PSRAM: %d\n", ESP.getFreePsram());
|
||||
|
||||
if (ESP.getPsramSize() == 0)
|
||||
{
|
||||
Serial.printf("PSRAM is required for this project!\nPlease ensure that it is enabled in arduino and also supported by your ESP32 controller.");
|
||||
while (true)
|
||||
{
|
||||
sleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ESP32
|
||||
Core0TaskInit();
|
||||
#else
|
||||
|
||||
+10
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Marcel Licence
|
||||
* Copyright (c) 2022 Marcel Licence
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -149,7 +149,7 @@ bool i2s_write_stereo_samples(float *fl_sample, float *fr_sample)
|
||||
sampleDataU.ch[1] = int32_t(*fl_sample * 1073741823.0f);
|
||||
#endif
|
||||
|
||||
static size_t bytes_written = 0;
|
||||
size_t bytes_written = 0;
|
||||
|
||||
#ifdef SAMPLE_SIZE_16BIT
|
||||
i2s_write(i2s_port_number, (const char *)&sampleDataU.sample, 4, &bytes_written, portMAX_DELAY);
|
||||
@@ -303,7 +303,11 @@ i2s_config_t i2s_configuration =
|
||||
#ifdef I2S_NODAC
|
||||
.bits_per_sample = I2S_BITS_PER_SAMPLE_32BIT,
|
||||
.channel_format = I2S_CHANNEL_FMT_ONLY_LEFT,
|
||||
#ifdef ARDUINO_RUNNING_CORE /* tested with arduino esp32 core version 2.0.2 */
|
||||
.communication_format = I2S_COMM_FORMAT_STAND_I2S,
|
||||
#else
|
||||
.communication_format = (i2s_comm_format_t)I2S_COMM_FORMAT_I2S_MSB,
|
||||
#endif
|
||||
#else
|
||||
#ifdef SAMPLE_SIZE_32BIT
|
||||
.bits_per_sample = I2S_BITS_PER_SAMPLE_32BIT, /* the DAC module will only take the 8bits from MSB */
|
||||
@@ -315,7 +319,11 @@ i2s_config_t i2s_configuration =
|
||||
.bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, /* the DAC module will only take the 8bits from MSB */
|
||||
#endif
|
||||
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
|
||||
#ifdef ARDUINO_RUNNING_CORE /* tested with arduino esp32 core version 2.0.2 */
|
||||
.communication_format = I2S_COMM_FORMAT_STAND_I2S,
|
||||
#else
|
||||
.communication_format = (i2s_comm_format_t)(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB),
|
||||
#endif
|
||||
#endif
|
||||
.intr_alloc_flags = 0, // default interrupt priority
|
||||
.dma_buf_count = 8,
|
||||
|
||||
Reference in New Issue
Block a user