Skip to content

Commit 6543338

Browse files
authored
I2s driver timeouts (#1978)
1 parent e43fa87 commit 6543338

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/AudioTools/CoreAudio/AudioAnalog/AnalogConfigESP32.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ namespace audio_tools {
2121
*/
2222
class AnalogConfigESP32 : public AudioInfo {
2323
public:
24+
TickType_t timeout = portMAX_DELAY;
2425
int buffer_count = ANALOG_BUFFER_COUNT;
2526
int buffer_size = ANALOG_BUFFER_SIZE;
2627
RxTxMode rx_tx_mode;

src/AudioTools/CoreAudio/AudioAnalog/AnalogDriverESP32.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class AnalogDriverESP32 : public AnalogDriverBase {
187187
size_t readBytes(uint8_t *dest, size_t size_bytes) override {
188188
TRACED();
189189
size_t result = 0;
190-
if (i2s_read(port_no, dest, size_bytes, &result, portMAX_DELAY)!=ESP_OK){
190+
if (i2s_read(port_no, dest, size_bytes, &result, adc_config.timeout)!=ESP_OK){
191191
TRACEE();
192192
}
193193
// make sure that the center is at 0
@@ -288,7 +288,7 @@ class AnalogDriverESP32 : public AnalogDriverBase {
288288
}
289289

290290
if (output_size>0){
291-
if (i2s_write(port_no, src, output_size, &result, portMAX_DELAY)!=ESP_OK){
291+
if (i2s_write(port_no, src, output_size, &result, adc_config.timeout)!=ESP_OK){
292292
LOGE("%s: %d", LOG_METHOD, output_size);
293293
}
294294
}

0 commit comments

Comments
 (0)