From d1f7d4a378880b64eadc5d18196c7f08e699e95a Mon Sep 17 00:00:00 2001 From: Gao Wei Date: Thu, 24 Oct 2024 22:01:04 +0800 Subject: [PATCH] feature: Support for Cpp Build --- .../esp32_korvo_du1906/board_def.h | 2 +- .../esp32_p4_function_ev_board/board_def.h | 4 +-- .../esp32_s2_kaluga_1_v1_2/board_def.h | 4 +-- .../audio_board/esp32_s3_box/board_def.h | 4 +-- .../audio_board/esp32_s3_box_3/board_def.h | 4 +-- .../audio_board/esp32_s3_box_lite/board_def.h | 4 +-- .../esp32_s3_korvo2_v3/board_def.h | 4 +-- .../esp32_s3_korvo2l_v1/board_def.h | 4 +-- .../audio_board/lyrat_mini_v1_1/board_def.h | 4 +-- components/audio_board/lyrat_v4_2/board_def.h | 4 +-- components/audio_board/lyrat_v4_3/board_def.h | 4 +-- .../audio_board/lyratd_msc_v2_1/board_def.h | 4 +-- .../audio_board/lyratd_msc_v2_2/board_def.h | 4 +-- components/audio_mixer/include/audio_mixer.h | 2 +- .../audio_pipeline/include/audio_element.h | 2 +- .../audio_recorder/include/recorder_sr.h | 30 +++++++++---------- .../audio_stream/include/embed_flash_stream.h | 9 +++++- components/audio_stream/include/i2s_stream.h | 18 +++++------ .../battery_service/include/battery_service.h | 19 ++++++------ components/esp-adf-libs | 2 +- .../esp_peripherals/include/periph_lcd.h | 3 +- .../include/audio_mixer_pipeline.h | 2 +- .../components/convert/include/cnv.h | 8 ++--- .../pixel_renderer/include/pixel_renderer.h | 8 ++--- examples/dueros/main/dueros_app.h | 8 +++++ 25 files changed, 88 insertions(+), 73 deletions(-) diff --git a/components/audio_board/esp32_korvo_du1906/board_def.h b/components/audio_board/esp32_korvo_du1906/board_def.h index b137c6931..cd8e8247d 100644 --- a/components/audio_board/esp32_korvo_du1906/board_def.h +++ b/components/audio_board/esp32_korvo_du1906/board_def.h @@ -57,7 +57,7 @@ * @brief Audio Codec Chip Function Definition */ #define FUNC_AUDIO_CODEC_EN (1) -#define CODEC_ADC_I2S_PORT (0) +#define CODEC_ADC_I2S_PORT ((i2s_port_t)0) #define ES7243_MCLK_GPIO GPIO_NUM_0 #define PA_ENABLE_GPIO GPIO_NUM_12 #define BOARD_PA_GAIN (10) /* Power amplifier gain defined by board (dB) */ diff --git a/components/audio_board/esp32_p4_function_ev_board/board_def.h b/components/audio_board/esp32_p4_function_ev_board/board_def.h index 4370f2c6c..deccd481c 100644 --- a/components/audio_board/esp32_p4_function_ev_board/board_def.h +++ b/components/audio_board/esp32_p4_function_ev_board/board_def.h @@ -58,8 +58,8 @@ #define ES8311_MCLK_SOURCE (1) /* 0 From MCLK of esp32 1 From BCLK */ #define HEADPHONE_DETECT (-1) #define PA_ENABLE_GPIO GPIO_NUM_53 -#define CODEC_ADC_I2S_PORT (0) -#define CODEC_ADC_BITS_PER_SAMPLE (16) /* 16bit */ +#define CODEC_ADC_I2S_PORT ((i2s_port_t)0) +#define CODEC_ADC_BITS_PER_SAMPLE ((i2s_data_bit_width_t)16) /* 16bit */ #define CODEC_ADC_SAMPLE_RATE (48000) #define RECORD_HARDWARE_AEC (true) #define BOARD_PA_GAIN (6) /* Power amplifier gain defined by board (dB) */ diff --git a/components/audio_board/esp32_s2_kaluga_1_v1_2/board_def.h b/components/audio_board/esp32_s2_kaluga_1_v1_2/board_def.h index b82545e86..cc9294b9e 100644 --- a/components/audio_board/esp32_s2_kaluga_1_v1_2/board_def.h +++ b/components/audio_board/esp32_s2_kaluga_1_v1_2/board_def.h @@ -73,8 +73,8 @@ #define FUNC_AUDIO_CODEC_EN (1) #define PA_ENABLE_GPIO (10) #define ES8311_MCLK_SOURCE (1) /* 0 From MCLK, 1 From BCLK */ -#define CODEC_ADC_I2S_PORT (0) -#define CODEC_ADC_BITS_PER_SAMPLE (16) /* 16bit */ +#define CODEC_ADC_I2S_PORT ((i2s_port_t)0) +#define CODEC_ADC_BITS_PER_SAMPLE ((i2s_data_bit_width_t)16) /* 16bit */ #define CODEC_ADC_SAMPLE_RATE (48000) #define RECORD_HARDWARE_AEC (false) #define BOARD_PA_GAIN (0) /* Power amplifier gain defined by board (dB) */ diff --git a/components/audio_board/esp32_s3_box/board_def.h b/components/audio_board/esp32_s3_box/board_def.h index 9c2f329e4..c1aa5b2dc 100644 --- a/components/audio_board/esp32_s3_box/board_def.h +++ b/components/audio_board/esp32_s3_box/board_def.h @@ -79,8 +79,8 @@ * @brief Audio Codec Chip Function Definition */ #define FUNC_AUDIO_CODEC_EN (1) -#define CODEC_ADC_I2S_PORT (0) -#define CODEC_ADC_BITS_PER_SAMPLE (32) /* 32bit */ +#define CODEC_ADC_I2S_PORT ((i2s_port_t)0) +#define CODEC_ADC_BITS_PER_SAMPLE ((i2s_data_bit_width_t)32) /* 32bit */ #define CODEC_ADC_SAMPLE_RATE (48000) #define RECORD_HARDWARE_AEC (true) #define BOARD_PA_GAIN (0) /* Power amplifier gain defined by board (dB) */ diff --git a/components/audio_board/esp32_s3_box_3/board_def.h b/components/audio_board/esp32_s3_box_3/board_def.h index 52fb89be8..cf55f3ed4 100644 --- a/components/audio_board/esp32_s3_box_3/board_def.h +++ b/components/audio_board/esp32_s3_box_3/board_def.h @@ -76,8 +76,8 @@ * @brief Audio Codec Chip Function Definition */ #define FUNC_AUDIO_CODEC_EN (1) -#define CODEC_ADC_I2S_PORT (0) -#define CODEC_ADC_BITS_PER_SAMPLE (32) /* 32bit */ +#define CODEC_ADC_I2S_PORT ((i2s_port_t)0) +#define CODEC_ADC_BITS_PER_SAMPLE ((i2s_data_bit_width_t)32) /* 32bit */ #define CODEC_ADC_SAMPLE_RATE (48000) #define RECORD_HARDWARE_AEC (true) #define BOARD_PA_GAIN (0) /* Power amplifier gain defined by board (dB) */ diff --git a/components/audio_board/esp32_s3_box_lite/board_def.h b/components/audio_board/esp32_s3_box_lite/board_def.h index 7b1dc584e..a78431e56 100644 --- a/components/audio_board/esp32_s3_box_lite/board_def.h +++ b/components/audio_board/esp32_s3_box_lite/board_def.h @@ -73,8 +73,8 @@ #define FUNC_AUDIO_CODEC_EN (1) #define HEADPHONE_DETECT -1 #define PA_ENABLE_GPIO GPIO_NUM_46 -#define CODEC_ADC_I2S_PORT (0) -#define CODEC_ADC_BITS_PER_SAMPLE I2S_BITS_PER_SAMPLE_32BIT +#define CODEC_ADC_I2S_PORT ((i2s_port_t)0) +#define CODEC_ADC_BITS_PER_SAMPLE ((i2s_data_bit_width_t)I2S_BITS_PER_SAMPLE_32BIT) #define CODEC_ADC_SAMPLE_RATE (48000) #define RECORD_HARDWARE_AEC (false) #define BOARD_PA_GAIN (0) /* Power amplifier gain defined by board (dB) */ diff --git a/components/audio_board/esp32_s3_korvo2_v3/board_def.h b/components/audio_board/esp32_s3_korvo2_v3/board_def.h index bbb891da4..eaf4dfd1d 100644 --- a/components/audio_board/esp32_s3_korvo2_v3/board_def.h +++ b/components/audio_board/esp32_s3_korvo2_v3/board_def.h @@ -110,8 +110,8 @@ * @brief Audio Codec Chip Function Definition */ #define FUNC_AUDIO_CODEC_EN (1) -#define CODEC_ADC_I2S_PORT (0) -#define CODEC_ADC_BITS_PER_SAMPLE (32) /* 32bit */ +#define CODEC_ADC_I2S_PORT ((i2s_port_t)0) +#define CODEC_ADC_BITS_PER_SAMPLE ((i2s_data_bit_width_t)32) /* 32bit */ #define CODEC_ADC_SAMPLE_RATE (48000) #define RECORD_HARDWARE_AEC (true) #define BOARD_PA_GAIN (6) /* Power amplifier gain defined by board (dB) */ diff --git a/components/audio_board/esp32_s3_korvo2l_v1/board_def.h b/components/audio_board/esp32_s3_korvo2l_v1/board_def.h index b13599bed..fd987b1af 100644 --- a/components/audio_board/esp32_s3_korvo2l_v1/board_def.h +++ b/components/audio_board/esp32_s3_korvo2l_v1/board_def.h @@ -118,8 +118,8 @@ #define ES8311_MCLK_SOURCE (1) /* 0 From MCLK of esp32 1 From BCLK */ #define HEADPHONE_DETECT (-1) #define PA_ENABLE_GPIO GPIO_NUM_46 -#define CODEC_ADC_I2S_PORT (0) -#define CODEC_ADC_BITS_PER_SAMPLE (16) /* 16bit */ +#define CODEC_ADC_I2S_PORT ((i2s_port_t)0) +#define CODEC_ADC_BITS_PER_SAMPLE ((i2s_data_bit_width_t)16) /* 16bit */ #define CODEC_ADC_SAMPLE_RATE (48000) #define RECORD_HARDWARE_AEC (true) #define BOARD_PA_GAIN (6) /* Power amplifier gain defined by board (dB) */ diff --git a/components/audio_board/lyrat_mini_v1_1/board_def.h b/components/audio_board/lyrat_mini_v1_1/board_def.h index 03aaebefe..863066d2e 100644 --- a/components/audio_board/lyrat_mini_v1_1/board_def.h +++ b/components/audio_board/lyrat_mini_v1_1/board_def.h @@ -55,8 +55,8 @@ #define HEADPHONE_DETECT GPIO_NUM_19 #define PA_ENABLE_GPIO GPIO_NUM_21 #define ES8311_MCLK_SOURCE 1 /* 0 From MCLK of esp32 1 From BCLK */ -#define CODEC_ADC_I2S_PORT (1) -#define CODEC_ADC_BITS_PER_SAMPLE (16) /* 16bit */ +#define CODEC_ADC_I2S_PORT ((i2s_port_t)1) +#define CODEC_ADC_BITS_PER_SAMPLE ((i2s_data_bit_width_t)16) /* 16bit */ #define CODEC_ADC_SAMPLE_RATE (16000) #define RECORD_HARDWARE_AEC (true) #define BOARD_PA_GAIN (20) /* Power amplifier gain defined by board (dB) */ diff --git a/components/audio_board/lyrat_v4_2/board_def.h b/components/audio_board/lyrat_v4_2/board_def.h index 099b58d60..6c4bfbf29 100644 --- a/components/audio_board/lyrat_v4_2/board_def.h +++ b/components/audio_board/lyrat_v4_2/board_def.h @@ -54,8 +54,8 @@ #define FUNC_AUDIO_CODEC_EN (1) #define AUXIN_DETECT_GPIO GPIO_NUM_12 #define PA_ENABLE_GPIO GPIO_NUM_21 -#define CODEC_ADC_I2S_PORT (0) -#define CODEC_ADC_BITS_PER_SAMPLE (16) /* 16bit */ +#define CODEC_ADC_I2S_PORT ((i2s_port_t)0) +#define CODEC_ADC_BITS_PER_SAMPLE ((i2s_data_bit_width_t)16) /* 16bit */ #define CODEC_ADC_SAMPLE_RATE (48000) #define RECORD_HARDWARE_AEC (false) #define BOARD_PA_GAIN (10) /* Power amplifier gain defined by board (dB) */ diff --git a/components/audio_board/lyrat_v4_3/board_def.h b/components/audio_board/lyrat_v4_3/board_def.h index 2a92d8853..747a5bc83 100644 --- a/components/audio_board/lyrat_v4_3/board_def.h +++ b/components/audio_board/lyrat_v4_3/board_def.h @@ -56,8 +56,8 @@ #define AUXIN_DETECT_GPIO GPIO_NUM_12 #define HEADPHONE_DETECT GPIO_NUM_19 #define PA_ENABLE_GPIO GPIO_NUM_21 -#define CODEC_ADC_I2S_PORT (0) -#define CODEC_ADC_BITS_PER_SAMPLE (16) /* 16bit */ +#define CODEC_ADC_I2S_PORT ((i2s_port_t)0) +#define CODEC_ADC_BITS_PER_SAMPLE ((i2s_data_bit_width_t)16) /* 16bit */ #define CODEC_ADC_SAMPLE_RATE (48000) #define RECORD_HARDWARE_AEC (false) #define BOARD_PA_GAIN (10) /* Power amplifier gain defined by board (dB) */ diff --git a/components/audio_board/lyratd_msc_v2_1/board_def.h b/components/audio_board/lyratd_msc_v2_1/board_def.h index 4ceeea7c5..636ade1ed 100644 --- a/components/audio_board/lyratd_msc_v2_1/board_def.h +++ b/components/audio_board/lyratd_msc_v2_1/board_def.h @@ -47,8 +47,8 @@ #define PA_ENABLE_GPIO GPIO_NUM_22 #define CODEC_RESET_GPIO GPIO_NUM_19 #define DSP_RESET_GPIO GPIO_NUM_21 -#define CODEC_ADC_I2S_PORT (0) -#define CODEC_ADC_BITS_PER_SAMPLE (16) /* 16bit */ +#define CODEC_ADC_I2S_PORT ((i2s_port_t)0) +#define CODEC_ADC_BITS_PER_SAMPLE ((i2s_data_bit_width_t)16) /* 16bit */ #define CODEC_ADC_SAMPLE_RATE (44100) #define RECORD_HARDWARE_AEC (false) #define BOARD_PA_GAIN (20) /* Power amplifier gain defined by board (dB) */ diff --git a/components/audio_board/lyratd_msc_v2_2/board_def.h b/components/audio_board/lyratd_msc_v2_2/board_def.h index 273cc6c6a..2501817eb 100644 --- a/components/audio_board/lyratd_msc_v2_2/board_def.h +++ b/components/audio_board/lyratd_msc_v2_2/board_def.h @@ -49,8 +49,8 @@ #define PA_ENABLE_GPIO GPIO_NUM_22 #define CODEC_RESET_GPIO GPIO_NUM_19 #define DSP_RESET_GPIO GPIO_NUM_21 -#define CODEC_ADC_I2S_PORT (0) -#define CODEC_ADC_BITS_PER_SAMPLE (16) /* 16bit */ +#define CODEC_ADC_I2S_PORT ((i2s_port_t)0) +#define CODEC_ADC_BITS_PER_SAMPLE ((i2s_data_bit_width_t)16) /* 16bit */ #define CODEC_ADC_SAMPLE_RATE (44100) #define RECORD_HARDWARE_AEC (false) #define BOARD_PA_GAIN (20) /* Power amplifier gain defined by board (dB) */ diff --git a/components/audio_mixer/include/audio_mixer.h b/components/audio_mixer/include/audio_mixer.h index 97f570088..fb9184a6a 100644 --- a/components/audio_mixer/include/audio_mixer.h +++ b/components/audio_mixer/include/audio_mixer.h @@ -44,9 +44,9 @@ extern "C" } #define AUDIO_MIXER_DEFAULT_CONF(samplerate, channels, bits_per_sample, max_slot) { \ - .sample_rate = samplerate, \ .channel = channels, \ .bits = bits_per_sample, \ + .sample_rate = samplerate, \ .task_stack = 4096, \ .task_prio = 6, \ .task_core = 1, \ diff --git a/components/audio_pipeline/include/audio_element.h b/components/audio_pipeline/include/audio_element.h index e9c79335c..9bf4db22c 100755 --- a/components/audio_pipeline/include/audio_element.h +++ b/components/audio_pipeline/include/audio_element.h @@ -142,7 +142,7 @@ typedef struct { typedef esp_err_t (*el_io_func)(audio_element_handle_t self); typedef audio_element_err_t (*process_func)(audio_element_handle_t self, char *el_buffer, int el_buf_len); -typedef audio_element_err_t (*stream_func)(audio_element_handle_t self, char *buffer, int len, TickType_t ticks_to_wait, +typedef int (*stream_func)(audio_element_handle_t self, char *buffer, int len, TickType_t ticks_to_wait, void *context); typedef esp_err_t (*event_cb_func)(audio_element_handle_t el, audio_event_iface_msg_t *event, void *ctx); typedef esp_err_t (*ctrl_func)(audio_element_handle_t self, void *in_data, int in_size, void *out_data, int *out_size); diff --git a/components/audio_recorder/include/recorder_sr.h b/components/audio_recorder/include/recorder_sr.h index 711d6da9e..2c92b5046 100644 --- a/components/audio_recorder/include/recorder_sr.h +++ b/components/audio_recorder/include/recorder_sr.h @@ -93,21 +93,21 @@ typedef struct { } #endif -#define DEFAULT_RECORDER_SR_CFG() { \ - .afe_cfg = AFE_CONFIG_DEFAULT(), \ - .input_order = INPUT_ORDER_DEFAULT(), \ - .multinet_init = true, \ - .feed_task_core = FEED_TASK_PINNED_CORE, \ - .feed_task_prio = FEED_TASK_PRIO, \ - .feed_task_stack = FEED_TASK_STACK_SZ, \ - .fetch_task_core = FETCH_TASK_PINNED_CORE, \ - .fetch_task_prio = FETCH_TASK_PRIO, \ - .fetch_task_stack = FETCH_TASK_STACK_SZ, \ - .rb_size = SR_OUTPUT_RB_SIZE, \ - .partition_label = "model", \ - .mn_language = ESP_MN_CHINESE, \ - .wn_wakeword = NULL, \ -}; +#define DEFAULT_RECORDER_SR_CFG() { \ + .afe_cfg = AFE_CONFIG_DEFAULT(), \ + .input_order = INPUT_ORDER_DEFAULT(), \ + .multinet_init = true, \ + .feed_task_core = FEED_TASK_PINNED_CORE, \ + .feed_task_prio = FEED_TASK_PRIO, \ + .feed_task_stack = FEED_TASK_STACK_SZ, \ + .fetch_task_core = FETCH_TASK_PINNED_CORE, \ + .fetch_task_prio = FETCH_TASK_PRIO, \ + .fetch_task_stack = FETCH_TASK_STACK_SZ, \ + .rb_size = SR_OUTPUT_RB_SIZE, \ + .partition_label = "model", \ + .mn_language = ESP_MN_CHINESE, \ + .wn_wakeword = NULL, \ +} /** * @brief Initialize sr processor, and the sr is disabled as default. diff --git a/components/audio_stream/include/embed_flash_stream.h b/components/audio_stream/include/embed_flash_stream.h index 61ad73d56..95c6da1c5 100644 --- a/components/audio_stream/include/embed_flash_stream.h +++ b/components/audio_stream/include/embed_flash_stream.h @@ -27,6 +27,10 @@ #include "audio_element.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Flash-embedding stream configurations, if any entry is zero then the configuration will be set to default values */ @@ -90,5 +94,8 @@ audio_element_handle_t embed_flash_stream_init(embed_flash_stream_cfg_t *config) */ esp_err_t embed_flash_stream_set_context(audio_element_handle_t embed_stream, const embed_item_info_t *context, int max_num); -#endif // __EMBED_FLASH_H__ +#ifdef __cplusplus +} +#endif +#endif // __EMBED_FLASH_H__ diff --git a/components/audio_stream/include/i2s_stream.h b/components/audio_stream/include/i2s_stream.h index e3bd33015..b6536cba1 100644 --- a/components/audio_stream/include/i2s_stream.h +++ b/components/audio_stream/include/i2s_stream.h @@ -189,7 +189,6 @@ typedef struct { #if SOC_I2S_SUPPORTS_TDM i2s_tdm_config_t tdm_cfg; /*!< I2S TDM mode major configuration that including clock/slot/gpio configuration */ #endif // SOC_I2S_SUPPORTS_TDM - i2s_data_bit_width_t expand_src_bits; /*!< The source bits per sample when data expand */ bool use_alc; /*!< It is a flag for ALC. If use ALC, the value is true. Or the value is false */ int volume; /*!< The volume of audio input data will be set. */ int out_rb_size; /*!< Size of output ringbuffer */ @@ -200,6 +199,7 @@ typedef struct { int multi_out_num; /*!< The number of multiple output */ bool uninstall_drv; /*!< whether uninstall the i2s driver when stream destroyed*/ bool need_expand; /*!< whether to expand i2s data */ + i2s_data_bit_width_t expand_src_bits; /*!< The source bits per sample when data expand */ int buffer_len; /*!< Buffer length use for an Element. Note: when 'bits_per_sample' is 24 bit, the buffer length must be a multiple of 3. The recommended value is 3600 */ } i2s_stream_cfg_t; @@ -251,6 +251,14 @@ typedef struct { #define I2S_STREAM_CFG_DEFAULT_WITH_TYLE_AND_CH(port, rate, bits, stream_type, channel) { \ .type = stream_type, \ + .transmit_mode = I2S_COMM_MODE_STD, \ + .chan_cfg = { \ + .id = port, \ + .role = I2S_ROLE_MASTER, \ + .dma_desc_num = 3, \ + .dma_frame_num = 312, \ + .auto_clear = true, \ + }, \ .std_cfg = { \ .clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG(rate), \ .slot_cfg = I2S_STD_PHILIPS_SLOT_DEFAULT_ADF_CONFIG(bits, channel), \ @@ -261,14 +269,6 @@ typedef struct { }, \ }, \ }, \ - .transmit_mode = I2S_COMM_MODE_STD, \ - .chan_cfg = { \ - .id = port, \ - .role = I2S_ROLE_MASTER, \ - .dma_desc_num = 3, \ - .dma_frame_num = 312, \ - .auto_clear = true, \ - }, \ .use_alc = false, \ .volume = 0, \ .out_rb_size = I2S_STREAM_RINGBUFFER_SIZE, \ diff --git a/components/battery_service/include/battery_service.h b/components/battery_service/include/battery_service.h index 866cf0e27..28b164d44 100644 --- a/components/battery_service/include/battery_service.h +++ b/components/battery_service/include/battery_service.h @@ -64,16 +64,15 @@ typedef struct { void *charger_monitor; /*!< Charger monitor. Not supported yet */ } battery_service_config_t; -#define BATTERY_SERVICE_DEFAULT_CONFIG() \ - { \ - .task_stack = 3 * 1024, \ - .task_prio = 6, \ - .task_core = 0, \ - .evt_cb = NULL, \ - .cb_ctx = NULL, \ - .extern_stack = true, \ - .vol_monitor = NULL, \ - } +#define BATTERY_SERVICE_DEFAULT_CONFIG() { \ + .task_stack = 3 * 1024, \ + .task_prio = 6, \ + .task_core = 0, \ + .extern_stack = true, \ + .evt_cb = NULL, \ + .cb_ctx = NULL, \ + .vol_monitor = NULL, \ +} /** * @brief Create the battery service instance diff --git a/components/esp-adf-libs b/components/esp-adf-libs index 0ae0c7d32..be13fc6cf 160000 --- a/components/esp-adf-libs +++ b/components/esp-adf-libs @@ -1 +1 @@ -Subproject commit 0ae0c7d32e36a6d8317765eab835299b06c894b5 +Subproject commit be13fc6cf799d05c78b029cee3e99d8ced3aee05 diff --git a/components/esp_peripherals/include/periph_lcd.h b/components/esp_peripherals/include/periph_lcd.h index 3608db26e..25e3aae4b 100644 --- a/components/esp_peripherals/include/periph_lcd.h +++ b/components/esp_peripherals/include/periph_lcd.h @@ -25,12 +25,13 @@ #ifndef _PERIPH_LCD_H_ #define _PERIPH_LCD_H_ +#include "esp_lcd_panel_io.h" // Do not use extern "C" with this header to avoid C++ linkage issues. + #ifdef __cplusplus extern "C" { #endif #if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0)) -#include "esp_lcd_panel_io.h" #include "esp_lcd_panel_vendor.h" #include "driver/spi_master.h" #include "esp_peripherals.h" diff --git a/examples/advanced_examples/audio_mixer_tone/components/audio_mixer_pipeline/include/audio_mixer_pipeline.h b/examples/advanced_examples/audio_mixer_tone/components/audio_mixer_pipeline/include/audio_mixer_pipeline.h index 4894ea73f..ebd4a3581 100644 --- a/examples/advanced_examples/audio_mixer_tone/components/audio_mixer_pipeline/include/audio_mixer_pipeline.h +++ b/examples/advanced_examples/audio_mixer_tone/components/audio_mixer_pipeline/include/audio_mixer_pipeline.h @@ -35,8 +35,8 @@ extern "C" #define MIXER_PIPELINE_TASK_PRIO (5) #define AUDIO_MIXER_PIPELINE_CFG_DEFAULT() { \ - .mixer = NULL, \ .url = NULL, \ + .mixer = NULL, \ .slot = 0, \ .resample_rate = 44100, \ .resample_channel = 2, \ diff --git a/examples/display/led_pixels/components/convert/include/cnv.h b/examples/display/led_pixels/components/convert/include/cnv.h index ce2809dbd..9cad04d78 100644 --- a/examples/display/led_pixels/components/convert/include/cnv.h +++ b/examples/display/led_pixels/components/convert/include/cnv.h @@ -42,16 +42,16 @@ extern "C" { #define CNV_CFG_DEFAULT() { \ .source_size = 2048, \ .audio_samplerate = CNV_AUDIO_SAMPLE, \ + .audio_resolution_bits = CNV_AUDIO_RESOLUTION_BITS, \ .n_samples = CNV_N_SAMPLES, \ - .default_rms_min = CNV_AUDIO_MIN_RMS, \ - .default_rms_max = CONFIG_EXAMPLE_DEFAULT_AUDIO_MAX_RMS, \ .window_max_width_db = CNV_AUDIO_WINDOW_MAX_WIDTH_DB, \ .regress_threshold_vol = CNV_AUDIO_REGRESS_THRESHOLD_VOL, \ - .audio_resolution_bits = CNV_AUDIO_RESOLUTION_BITS, \ + .default_rms_min = CNV_AUDIO_MIN_RMS, \ + .default_rms_max = CONFIG_EXAMPLE_DEFAULT_AUDIO_MAX_RMS, \ .total_leds = CNV_TOTAL_LEDS, \ .task_stack = 3072, \ - .task_core = 0, \ .task_prio = 12, \ + .task_core = 0, \ } typedef struct cnv_handle_s cnv_handle_t; diff --git a/examples/display/led_pixels/components/pixel_renderer/include/pixel_renderer.h b/examples/display/led_pixels/components/pixel_renderer/include/pixel_renderer.h index 1ce25a93c..7d274666a 100644 --- a/examples/display/led_pixels/components/pixel_renderer/include/pixel_renderer.h +++ b/examples/display/led_pixels/components/pixel_renderer/include/pixel_renderer.h @@ -38,25 +38,25 @@ extern "C" { #define PIXEL_RENDERER_CTRL_IO (CONFIG_EXAMPLE_LED_CTRL_IO) /*!< LED control signal pin */ #define PIXEL_RENDERER_CFG_DEFAULT() { \ - .total_leds = CNV_TOTAL_LEDS, \ .x_axis_points = CNV_TOTAL_LEDS, \ .y_axis_points = 1, \ .origin_offset = 0, \ + .total_leds = CNV_TOTAL_LEDS, \ .queue_size = 3, \ .task_stack = 3072, \ - .task_core = 0, \ .task_prio = 21, \ + .task_core = 0, \ } #define PIXEL_RENDERER_SPECTRUM_DISPLAY_CFG_DEFAULT() { \ - .total_leds = 64, \ .x_axis_points = 8, \ .y_axis_points = 8, \ .origin_offset = 7, \ + .total_leds = 64, \ .queue_size = 3, \ .task_stack = 3072, \ - .task_core = 0, \ .task_prio = 21, \ + .task_core = 0, \ } typedef struct pixel_renderer_handle pixel_renderer_handle_t; diff --git a/examples/dueros/main/dueros_app.h b/examples/dueros/main/dueros_app.h index f5b5f2c30..b3fa01391 100644 --- a/examples/dueros/main/dueros_app.h +++ b/examples/dueros/main/dueros_app.h @@ -25,6 +25,14 @@ #ifndef _DUER_APP_H_ #define _DUER_APP_H_ +#ifdef __cplusplus +extern "C" { +#endif + void duer_app_init(void); +#ifdef __cplusplus +} +#endif + #endif