From 3809e0ab1492a47d452e43f4149805f1ade6a4f0 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Sun, 24 Feb 2019 15:31:10 +0100 Subject: [PATCH] stm32-f4discovery-cc256x: provided hal_audio_sink_stop --- .../src/hal_audio_f4discovery.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/port/stm32-f4discovery-cc256x/src/hal_audio_f4discovery.c b/port/stm32-f4discovery-cc256x/src/hal_audio_f4discovery.c index d58c470ad..fe7602a4d 100644 --- a/port/stm32-f4discovery-cc256x/src/hal_audio_f4discovery.c +++ b/port/stm32-f4discovery-cc256x/src/hal_audio_f4discovery.c @@ -139,12 +139,21 @@ void hal_audio_sink_start(void){ BSP_AUDIO_OUT_Play( (uint16_t*) output_buffer, NUM_OUTPUT_BUFFERS * OUTPUT_BUFFER_NUM_SAMPLES * 4); } +/** + * @brief Stop stream + */ +void hal_audio_sink_stop(void){ + started = 0; + BSP_AUDIO_OUT_Stop(CODEC_PDWN_HW); +} + /** * @brief Close audio codec */ void hal_audio_sink_close(void){ - started = 0; - BSP_AUDIO_OUT_Stop(CODEC_PDWN_HW); + if (started){ + hal_audio_sink_close(); + } }