From c4b3e553ae309adb84e94250307d014c9fe0d4b9 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 20 Jul 2018 16:31:14 +0200 Subject: [PATCH] stm32-f4discovery-cc256x: use new hal_audio implementation --- .../cubemx-f4discovery-cc256x/Makefile | 6 +++++- port/stm32-f4discovery-cc256x/src/btstack_config.h | 2 +- port/stm32-f4discovery-cc256x/src/port.c | 6 ++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/port/stm32-f4discovery-cc256x/cubemx-f4discovery-cc256x/Makefile b/port/stm32-f4discovery-cc256x/cubemx-f4discovery-cc256x/Makefile index b7d34a338..5011fc186 100644 --- a/port/stm32-f4discovery-cc256x/cubemx-f4discovery-cc256x/Makefile +++ b/port/stm32-f4discovery-cc256x/cubemx-f4discovery-cc256x/Makefile @@ -90,7 +90,10 @@ att_db.c \ att_dispatch.c \ att_server.c \ battery_service_server.c \ +btstack_audio.c \ +btstack_audio_embedded.c \ btstack_crypto.c \ +btstack_cvsd_plc.c \ btstack_linked_list.c \ btstack_memory.c \ btstack_memory_pool.c \ @@ -115,7 +118,6 @@ sm.c \ uECC.c \ btstack_chipset_cc256x.c \ bluetooth_init_cc2564B_1.6_BT_Spec_4.1.c \ -hal_audio_dma.c \ hal_flash_bank_stm32.c \ btstack_tlv_flash_bank.c \ le_device_db_tlv.c \ @@ -124,6 +126,7 @@ audio.c \ cs43l22.c \ stm32f4_discovery.c \ stm32f4_discovery_audio.c \ +hal_audio_f4discovery.c \ a2dp_sink.c \ a2dp_source.c \ avdtp.c \ @@ -302,6 +305,7 @@ EXAMPLES = \ hog_mouse_demo \ hsp_ag_demo \ hsp_hs_demo \ + mod_player \ le_counter \ le_streamer \ le_streamer_client \ diff --git a/port/stm32-f4discovery-cc256x/src/btstack_config.h b/port/stm32-f4discovery-cc256x/src/btstack_config.h index 75600cf01..5ce84e657 100644 --- a/port/stm32-f4discovery-cc256x/src/btstack_config.h +++ b/port/stm32-f4discovery-cc256x/src/btstack_config.h @@ -7,7 +7,7 @@ // Port related features #define HAVE_EMBEDDED_TIME_MS -#define HAVE_AUDIO_DMA +#define HAVE_HAL_AUDIO #define HAVE_BTSTACK_STDIN // BTstack features that can be enabled diff --git a/port/stm32-f4discovery-cc256x/src/port.c b/port/stm32-f4discovery-cc256x/src/port.c index 8064231bd..1ee6a414f 100644 --- a/port/stm32-f4discovery-cc256x/src/port.c +++ b/port/stm32-f4discovery-cc256x/src/port.c @@ -6,6 +6,7 @@ #include "port.h" #include "btstack.h" #include "btstack_debug.h" +#include "btstack_audio.h" #include "btstack_chipset_cc256x.h" #include "btstack_run_loop_embedded.h" #include "btstack_tlv.h" @@ -341,6 +342,11 @@ void port_main(void){ // setup LE Device DB using TLV le_device_db_tlv_configure(btstack_tlv_impl, &btstack_tlv_flash_bank_context); +#ifdef HAVE_HAL_AUDIO + // setup audio + btstack_audio_set_instance(btstack_audio_embedded_get_instance()); +#endif + // inform about BTstack state hci_event_callback_registration.callback = &packet_handler; hci_add_event_handler(&hci_event_callback_registration);