Skip to content

Commit 2a95e1f

Browse files
committed
Merge branch 'bugfix/cmake_for_custom_audio_board' into 'master'
Bugfix/cmake for custom audio board See merge request adf/esp-adf-internal!432
2 parents 37fd328 + 0f38a98 commit 2a95e1f

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Edit following two lines to set component requirements (see docs)
2+
set(COMPONENT_REQUIRES)
3+
set(COMPONENT_PRIV_REQUIRES audio_sal audio_hal esp_dispatcher esp_peripherals display_service)
4+
5+
if(CONFIG_AUDIO_BOARD_CUSTOM)
6+
message(STATUS "Current board name is " CONFIG_AUDIO_BOARD_CUSTOM)
7+
list(APPEND COMPONENT_ADD_INCLUDEDIRS ./my_board_v1_0 ./my_codec_driver)
8+
set(COMPONENT_SRCS
9+
./my_board_v1_0/board.c
10+
./my_board_v1_0/board_pins_config.c
11+
./my_codec_driver/new_codec.c
12+
)
13+
endif()
14+
15+
register_component()
16+
17+
IF (IDF_VER MATCHES "v4.")
18+
idf_component_get_property(audio_board_lib audio_board COMPONENT_LIB)
19+
set_property(TARGET ${audio_board_lib} APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${COMPONENT_LIB})
20+
21+
ELSEIF (IDF_VER MATCHES "v3.")
22+
set_property(TARGET idf_component_audio_board APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:${COMPONENT_TARGET},INTERFACE_INCLUDE_DIRECTORIES>)
23+
24+
ENDIF (IDF_VER MATCHES "v4.")

examples/get-started/play_mp3/components/my_board/my_codec_driver/new_codec.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,14 @@ audio_hal_func_t AUDIO_NEW_CODEC_DEFAULT_HANDLE = {
4444
.audio_codec_get_volume = new_codec_get_voice_volume,
4545
};
4646

47-
static bool new_codec_initialized()
47+
bool new_codec_initialized()
4848
{
4949
return codec_init_flag;
5050
}
5151

5252
esp_err_t new_codec_init(audio_hal_codec_config_t *cfg)
5353
{
54+
ESP_LOGI(TAG, "new_codec init");
5455
return ESP_OK;
5556
}
5657

0 commit comments

Comments
 (0)