Skip to content

Commit

Permalink
Arduino.3.0: enable Audio libs compile by disabling incompatible I2S …
Browse files Browse the repository at this point in the history
…driver (#19377)

* i2s off for Arduino 3.0
  • Loading branch information
Jason2866 authored Aug 24, 2023
1 parent 9b6efc6 commit 312bbbb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions lib/lib_audio/ESP8266Audio/src/AudioOutputI2S.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

#include <Arduino.h>
#if ESP_IDF_VERSION_MAJOR < 5 // TODO Arduino 3.0 Port I2S
#ifdef ESP32
#include "driver/i2s.h"
#elif defined(ARDUINO_ARCH_RP2040) || ARDUINO_ESP8266_MAJOR >= 3
Expand Down Expand Up @@ -374,3 +375,4 @@ bool AudioOutputI2S::stop()
i2sOn = false;
return true;
}
#endif // TODO Arduino 3.0 Port I2S
2 changes: 2 additions & 0 deletions lib/lib_audio/ESP8266Audio/src/AudioOutputI2SNoDAC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

#include <Arduino.h>
#if ESP_IDF_VERSION_MAJOR < 5 // TODO Arduino 3.0 Port I2S
#ifdef ESP32
#include "driver/i2s.h"
#elif defined(ARDUINO_ARCH_RP2040) || ARDUINO_ESP8266_MAJOR >= 3
Expand Down Expand Up @@ -119,3 +120,4 @@ bool AudioOutputI2SNoDAC::ConsumeSample(int16_t sample[2])
#endif
return true;
}
#endif // ESP_IDF_VERSION_MAJOR < 5 // TODO Arduino 3.0 Port I2S
3 changes: 3 additions & 0 deletions lib/lib_audio/ESP8266Audio/src/AudioOutputSPDIF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#if defined(ESP32) || defined(ESP8266)

#include <Arduino.h>
#if ESP_IDF_VERSION_MAJOR < 5 // TODO Arduino 3.0 Port I2S
#if defined(ESP32)
#include "driver/i2s.h"
#include "soc/rtc.h"
Expand Down Expand Up @@ -293,3 +295,4 @@ bool AudioOutputSPDIF::stop()
}

#endif
#endif // ESP_IDF_VERSION_MAJOR < 5 // TODO Arduino 3.0 Port I2S
4 changes: 4 additions & 0 deletions lib/lib_audio/ESP8266Audio/src/AudioOutputULP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <Arduino.h>
#if ESP_IDF_VERSION_MAJOR < 5 // TODO Arduino 3.0 Port I2S

#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2

#include "AudioOutputULP.h"
Expand Down Expand Up @@ -260,3 +263,4 @@ bool AudioOutputULP::stop()
}

#endif
#endif // ESP_IDF_VERSION_MAJOR < 5 // TODO Arduino 3.0 Port I2S
7 changes: 2 additions & 5 deletions platformio_tasmota_core3_env_sample.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@

[core32_30]
platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5
platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/1511/framework-arduinoespressif32-release_v5.1-90b05eff62.zip
platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/1532/framework-arduinoespressif32-release_v5.1-303acc246e.zip
build_unflags = ${core32.build_unflags}
build_flags = ${core32.build_flags}

[core32_30_flags]
build_unflags = ${core32_30.build_unflags}
-DUSE_IPV6
build_flags = ${core32_30.build_flags}
lib_extra_dirs = lib/lib_ssl, lib/lib_basic, lib/lib_i2c, lib/lib_div, lib/lib_display, lib/lib_rf, lib/libesp32, lib/libesp32_div, lib/libesp32_lvgl
lib_extra_dirs = lib/lib_ssl, lib/lib_basic, lib/lib_i2c, lib/lib_div, lib/lib_audio, lib/lib_display, lib/lib_rf, lib/libesp32, lib/libesp32_div, lib/libesp32_lvgl
lib_ignore =
HTTPUpdateServer
USB
Expand All @@ -43,8 +43,6 @@ lib_ignore =
ArduinoOTA
ESP Mail Client
IRremoteESP8266
ESP8266Audio
ESP8266SAM
ESP32-HomeKit
NimBLE-Arduino

Expand Down Expand Up @@ -82,7 +80,6 @@ lib_ignore = ${env:arduino30.lib_ignore}
extends = env:arduino30
board = esp32-fix
board_build.f_cpu = 240000000L
upload_port = /dev/cu.SLAB_USBtoUART
build_unflags = ${env:arduino30.build_unflags}
build_flags = ${env:arduino30.build_flags}
-DFIRMWARE_ARDUINO30
Expand Down

0 comments on commit 312bbbb

Please sign in to comment.