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(); + } }