From e692dd82d25f73640c98af4ac90ff03e6a7231ae Mon Sep 17 00:00:00 2001 From: raldone01 Date: Mon, 7 Dec 2020 19:29:52 +0100 Subject: [PATCH 1/2] Fixed a type error when using the I2S_STREAM_XX_CFG_DEFAULT() macros in cpp --- components/audio_stream/include/i2s_stream.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/audio_stream/include/i2s_stream.h b/components/audio_stream/include/i2s_stream.h index 15599303f..3d6f8fc57 100644 --- a/components/audio_stream/include/i2s_stream.h +++ b/components/audio_stream/include/i2s_stream.h @@ -61,7 +61,7 @@ typedef struct { #define I2S_STREAM_CFG_DEFAULT() { \ .type = AUDIO_STREAM_WRITER, \ .i2s_config = { \ - .mode = I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_RX, \ + .mode = (i2s_mode_t) I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_RX, \ .sample_rate = 44100, \ .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, \ .channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT, \ @@ -88,7 +88,7 @@ typedef struct { #define I2S_STREAM_INTERNAL_DAC_CFG_DEFAULT() { \ .type = AUDIO_STREAM_WRITER, \ .i2s_config = { \ - .mode = I2S_MODE_MASTER | I2S_MODE_DAC_BUILT_IN | I2S_MODE_TX, \ + .mode = (i2s_mode_t) I2S_MODE_MASTER | I2S_MODE_DAC_BUILT_IN | I2S_MODE_TX, \ .sample_rate = 44100, \ .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, \ .channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT, \ @@ -115,7 +115,7 @@ typedef struct { #define I2S_STREAM_TX_PDM_CFG_DEFAULT() { \ .type = AUDIO_STREAM_WRITER, \ .i2s_config = { \ - .mode = I2S_MODE_MASTER | I2S_MODE_PDM | I2S_MODE_TX, \ + .mode = (i2s_mode_t) I2S_MODE_MASTER | I2S_MODE_PDM | I2S_MODE_TX, \ .sample_rate = 44100, \ .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, \ .channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT, \ From e6c55760b7b8f17c18fc74a85ab15e7d485f54ae Mon Sep 17 00:00:00 2001 From: raldone01 Date: Mon, 7 Dec 2020 19:40:27 +0100 Subject: [PATCH 2/2] Added brackets. --- components/audio_stream/include/i2s_stream.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/audio_stream/include/i2s_stream.h b/components/audio_stream/include/i2s_stream.h index 3d6f8fc57..c9ae5c683 100644 --- a/components/audio_stream/include/i2s_stream.h +++ b/components/audio_stream/include/i2s_stream.h @@ -61,7 +61,7 @@ typedef struct { #define I2S_STREAM_CFG_DEFAULT() { \ .type = AUDIO_STREAM_WRITER, \ .i2s_config = { \ - .mode = (i2s_mode_t) I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_RX, \ + .mode = (i2s_mode_t) (I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_RX), \ .sample_rate = 44100, \ .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, \ .channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT, \ @@ -88,7 +88,7 @@ typedef struct { #define I2S_STREAM_INTERNAL_DAC_CFG_DEFAULT() { \ .type = AUDIO_STREAM_WRITER, \ .i2s_config = { \ - .mode = (i2s_mode_t) I2S_MODE_MASTER | I2S_MODE_DAC_BUILT_IN | I2S_MODE_TX, \ + .mode = (i2s_mode_t) (I2S_MODE_MASTER | I2S_MODE_DAC_BUILT_IN | I2S_MODE_TX), \ .sample_rate = 44100, \ .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, \ .channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT, \ @@ -115,7 +115,7 @@ typedef struct { #define I2S_STREAM_TX_PDM_CFG_DEFAULT() { \ .type = AUDIO_STREAM_WRITER, \ .i2s_config = { \ - .mode = (i2s_mode_t) I2S_MODE_MASTER | I2S_MODE_PDM | I2S_MODE_TX, \ + .mode = (i2s_mode_t) (I2S_MODE_MASTER | I2S_MODE_PDM | I2S_MODE_TX), \ .sample_rate = 44100, \ .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, \ .channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT, \