diff --git a/examples/get-started/play_mp3/components/my_board/CMakeLists.txt b/examples/get-started/play_mp3/components/my_board/CMakeLists.txt new file mode 100644 index 000000000..af1e32369 --- /dev/null +++ b/examples/get-started/play_mp3/components/my_board/CMakeLists.txt @@ -0,0 +1,24 @@ +# Edit following two lines to set component requirements (see docs) +set(COMPONENT_REQUIRES) +set(COMPONENT_PRIV_REQUIRES audio_sal audio_hal esp_dispatcher esp_peripherals display_service) + +if(CONFIG_AUDIO_BOARD_CUSTOM) +message(STATUS "Current board name is " CONFIG_AUDIO_BOARD_CUSTOM) +list(APPEND COMPONENT_ADD_INCLUDEDIRS ./my_board_v1_0 ./my_codec_driver) +set(COMPONENT_SRCS +./my_board_v1_0/board.c +./my_board_v1_0/board_pins_config.c +./my_codec_driver/new_codec.c +) +endif() + +register_component() + +IF (IDF_VER MATCHES "v4.") +idf_component_get_property(audio_board_lib audio_board COMPONENT_LIB) +set_property(TARGET ${audio_board_lib} APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${COMPONENT_LIB}) + +ELSEIF (IDF_VER MATCHES "v3.") +set_property(TARGET idf_component_audio_board APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $) + +ENDIF (IDF_VER MATCHES "v4.") diff --git a/examples/get-started/play_mp3/components/my_board/my_codec_driver/new_codec.c b/examples/get-started/play_mp3/components/my_board/my_codec_driver/new_codec.c index f9a960638..b948d93b3 100644 --- a/examples/get-started/play_mp3/components/my_board/my_codec_driver/new_codec.c +++ b/examples/get-started/play_mp3/components/my_board/my_codec_driver/new_codec.c @@ -44,13 +44,14 @@ audio_hal_func_t AUDIO_NEW_CODEC_DEFAULT_HANDLE = { .audio_codec_get_volume = new_codec_get_voice_volume, }; -static bool new_codec_initialized() +bool new_codec_initialized() { return codec_init_flag; } esp_err_t new_codec_init(audio_hal_codec_config_t *cfg) { + ESP_LOGI(TAG, "new_codec init"); return ESP_OK; }