Skip to content
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
18 changes: 10 additions & 8 deletions platformio.ini
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
[platformio]

[env]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.32/platform-espressif32.zip
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.37/platform-espressif32.zip
board_build.partitions = huge_app.csv
framework = arduino
extra_scripts = pre:version.py
build_flags =
-D PIOENV="\"$PIOENV"\"
; -D STACK_HIGH_WATERMARK_LOG
lib_deps =
https://github.com/pschatzmann/ESP32-A2DP.git#v1.8.8
https://github.com/pschatzmann/arduino-audio-tools.git#v1.2.0
https://github.com/pschatzmann/arduino-audio-driver.git#v0.1.4
https://github.com/pschatzmann/ESP32-A2DP.git @~1.8.9
https://github.com/pschatzmann/arduino-audio-tools.git @~1.2.2
https://github.com/pschatzmann/arduino-audio-driver.git @~0.2.1
; https://github.com/pschatzmann/ESP32-A2DP.git
; https://github.com/pschatzmann/arduino-audio-tools.git
; https://github.com/pschatzmann/arduino-audio-driver.git
;https://github.com/martinroger/espod.git
monitor_filters = esp32_exception_decoder
monitor_speed = 115200

[env:SBC_NodeMCU32S]
build_type = debug
build_flags =
${env.build_flags}
-D CORE_DEBUG_LEVEL=2
-D CORE_DEBUG_LEVEL=3
-D UART1_RX=16
-D UART1_TX=17
; -D INVERT_LED_LOGIC
board = nodemcu-32s
lib_deps =
${env.lib_deps}
https://github.com/martinroger/espod.git#v0.1.0
https://github.com/martinroger/espod.git @~0.1.0
lib_ignore = audio-driver

[env:a1sMini]
Expand All @@ -43,8 +47,6 @@ build_flags =
-D INVERT_LED_LOGIC
-D CORE_DEBUG_LEVEL=3
-D A2DP_SINK_NAME="\"A1S MiniPod"\"


lib_deps =
${env.lib_deps}
https://github.com/martinroger/espod.git#v0.1.0
Expand Down
22 changes: 11 additions & 11 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@
#ifndef A2DP_SINK_NAME
#define A2DP_SINK_NAME "espiPod"
#endif
#ifndef WS_PIN
#define WS_PIN 25
#endif
#ifndef DIN_PIN
#define DIN_PIN 26
#endif
#ifndef BCLK_PIN
#define BCLK_PIN 27
#endif

#ifdef AUDIOKIT // Using the AiThink A1S AudioKit chip
#include "AudioBoard.h"
Expand All @@ -55,15 +64,6 @@ BluetoothA2DPSink a2dp_sink(i2s);
#else // Case not using the audiokit, like Sandwich Carrier Board
I2SStream i2s;
BluetoothA2DPSink a2dp_sink;
#ifndef WS_PIN
#define WS_PIN 25
#endif
#ifndef DIN_PIN
#define DIN_PIN 26
#endif
#ifndef BCLK_PIN
#define BCLK_PIN 26
#endif
#endif

/// @brief Data stream reader callback
Expand Down Expand Up @@ -219,8 +219,8 @@ void initializeA2DPSink()
{
#ifdef AUDIOKIT
minimalPins.addI2C(PinFunction::CODEC, 32, 33);
minimalPins.addI2S(PinFunction::CODEC, 0, 27, 25, 26, 35);
a2dp_sink.set_stream_reader(read_data_stream, false); // Might need commenting out
minimalPins.addI2S(PinFunction::CODEC, 0, BCLK_PIN, WS_PIN, DIN_PIN, 35);
// a2dp_sink.set_stream_reader(read_data_stream, false); // Might need commenting out
auto cfg = i2s.defaultConfig();
cfg.copyFrom(info);
i2s.begin(cfg);
Expand Down