Skip to content

Commit 774bc93

Browse files
committed
Fix some ESP32 compile warnings
1 parent 3ca967f commit 774bc93

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/AudioI2S/I2SESP32.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,14 @@ class I2SBase {
338338
#if defined(USE_I2S_ANALOG)
339339
mode = (i2s_mode_t) (cfg.rx_tx_mode ? I2S_MODE_DAC_BUILT_IN : I2S_MODE_ADC_BUILT_IN);
340340
#else
341-
LOGE("Not supported");
341+
LOGE("mode not supported");
342342
#endif
343343
break;
344+
345+
default:
346+
LOGW("signal_type undefined");
347+
mode = (i2s_mode_t) (I2S_MODE_MASTER | I2S_MODE_TX);
348+
break;
344349
}
345350
return mode;
346351
}

src/AudioTools/AudioStreams.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ class MemoryStream : public AudioStream {
274274
buffer_size = size;
275275
switch(memory_type){
276276
#ifdef ESP32
277-
PS_RAM:
277+
case PS_RAM:
278278
buffer = (buffer==nullptr) ? (uint8_t*)ps_calloc(size,1) : (uint8_t*)ps_realloc(buffer, size);
279279
break;
280280
#endif

src/AudioTools/AudioStreamsConverter.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,16 @@ class ChannelFormatConverterStream : public AudioStreamX {
120120
switch(bits_per_sample){
121121
case 8:
122122
static_cast<ChannelFormatConverterStreamT<int8_t>*>(converter)->setAudioInfo(cfg);
123+
break;
123124
case 16:
124125
static_cast<ChannelFormatConverterStreamT<int16_t>*>(converter)->setAudioInfo(cfg);
126+
break;
125127
case 24:
126128
static_cast<ChannelFormatConverterStreamT<int24_t>*>(converter)->setAudioInfo(cfg);
129+
break;
127130
case 32:
128131
static_cast<ChannelFormatConverterStreamT<int32_t>*>(converter)->setAudioInfo(cfg);
132+
break;
129133
}
130134
}
131135

0 commit comments

Comments
 (0)