From 1c00f28917faf559d5dec77b7541b2427ed13d3c Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 9 Jan 2024 15:09:15 +0100 Subject: [PATCH] posix-h4-nxp: enable audio support --- port/posix-h4-nxp/CMakeLists.txt | 2 +- port/posix-h4-nxp/main.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/port/posix-h4-nxp/CMakeLists.txt b/port/posix-h4-nxp/CMakeLists.txt index d34fe5e98..8d7fc249e 100644 --- a/port/posix-h4-nxp/CMakeLists.txt +++ b/port/posix-h4-nxp/CMakeLists.txt @@ -43,7 +43,7 @@ include_directories(${BTSTACK_ROOT}/platform/lwip) include_directories(${BTSTACK_ROOT}/platform/lwip/port) include_directories(${BTSTACK_ROOT}/platform/posix) -file(GLOB SOURCES_SRC "${BTSTACK_ROOT}/src/*.c" "${BTSTACK_ROOT}/example/sco_demo_util.c") +file(GLOB SOURCES_SRC "${BTSTACK_ROOT}/src/*.c" "${BTSTACK_ROOT}/example/*demo_util*.c") file(GLOB SOURCES_BLE "${BTSTACK_ROOT}/src/ble/*.c") file(GLOB SOURCES_BLUEDROID "${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/srce/*.c" "${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/srce/*.c") file(GLOB SOURCES_CLASSIC "${BTSTACK_ROOT}/src/classic/*.c") diff --git a/port/posix-h4-nxp/main.c b/port/posix-h4-nxp/main.c index 491e1b1af..3caf97167 100644 --- a/port/posix-h4-nxp/main.c +++ b/port/posix-h4-nxp/main.c @@ -54,6 +54,7 @@ #include "ble/le_device_db_tlv.h" #include "btstack_chipset_nxp.h" +#include "btstack_audio.h" #include "btstack_debug.h" #include "btstack_event.h" #include "btstack_memory.h" @@ -169,6 +170,11 @@ static void nxp_phase2(uint8_t status){ hci_init(transport, (void*) &transport_config); hci_set_chipset(btstack_chipset_nxp_instance()); +#ifdef HAVE_PORTAUDIO + btstack_audio_sink_set_instance(btstack_audio_portaudio_sink_get_instance()); + btstack_audio_source_set_instance(btstack_audio_portaudio_source_get_instance()); +#endif + // inform about BTstack state hci_event_callback_registration.callback = &packet_handler; hci_add_event_handler(&hci_event_callback_registration);