Skip to content

Commit 9b8be07

Browse files
committed
ESP32 Open I2S in douplex mode by default
1 parent 96fa64e commit 9b8be07

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/AudioTools/CoreAudio/AudioI2S/I2SESP32V1.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class I2SDriverESP32V1 {
8484

8585
/// stops the I2C and unistalls the driver
8686
void end() {
87-
TRACED();
87+
TRACEI();
8888
if (rx_chan != nullptr) {
8989
i2s_channel_disable(rx_chan);
9090
i2s_del_channel(rx_chan);
@@ -106,6 +106,7 @@ class I2SDriverESP32V1 {
106106
size_t writeBytes(const void *src, size_t size_bytes) {
107107
TRACED();
108108
size_t result;
109+
assert(tx_chan !=nullptr);
109110
if (i2s_channel_write(tx_chan, src, size_bytes, &result,
110111
ticks_to_wait_write) != ESP_OK) {
111112
TRACEE();
@@ -130,7 +131,7 @@ class I2SDriverESP32V1 {
130131
}
131132

132133
protected:
133-
I2SConfigESP32V1 cfg = defaultConfig(RX_MODE);
134+
I2SConfigESP32V1 cfg = defaultConfig(RXTX_MODE);
134135
i2s_std_config_t i2s_config;
135136
i2s_chan_handle_t tx_chan = nullptr; // I2S tx channel handler
136137
i2s_chan_handle_t rx_chan = nullptr; // I2S rx channel handler

src/AudioTools/CoreAudio/AudioI2S/I2SStream.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class I2SStream : public AudioStream {
5151
}
5252

5353
bool begin() {
54-
TRACED();
54+
TRACEI();
5555
I2SConfig cfg = i2s.config();
5656
if (!cfg){
5757
LOGE("unsuported AudioInfo: sample_rate: %d / channels: %d / bits_per_sample: %d", (int) cfg.sample_rate, (int)cfg.channels, (int)cfg.bits_per_sample);
@@ -82,7 +82,7 @@ class I2SStream : public AudioStream {
8282

8383
/// Stops the I2S interface
8484
void end() {
85-
TRACED();
85+
TRACEI();
8686
is_active = false;
8787
mute(true);
8888
i2s.end();

0 commit comments

Comments
 (0)