From d861f4bf320a2cec64af5eb3b38df10283b2e2c7 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 1 Feb 2019 17:35:43 +0100 Subject: [PATCH] example/sco_demo_util: fix compile for non-audio modes --- example/sco_demo_util.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/example/sco_demo_util.c b/example/sco_demo_util.c index c4354fcdf..22636a5e3 100644 --- a/example/sco_demo_util.c +++ b/example/sco_demo_util.c @@ -91,16 +91,17 @@ #define MSBC_SAMPLE_RATE 16000 #define BYTES_PER_FRAME 2 -#if (SCO_DEMO_MODE == SCO_DEMO_MODE_SINE || SCO_DEMO_MODE == SCO_DEMO_MODE_MICROPHONE) #define CVSD_PA_PREBUFFER_BYTES (SCO_CVSD_PA_PREBUFFER_MS * CVSD_SAMPLE_RATE/1000 * BYTES_PER_FRAME) #define MSBC_PA_PREBUFFER_BYTES (SCO_MSBC_PA_PREBUFFER_MS * MSBC_SAMPLE_RATE/1000 * BYTES_PER_FRAME) -#endif // output -static int audio_output_paused = 0; +#if (SCO_DEMO_MODE == SCO_DEMO_MODE_SINE) || (SCO_DEMO_MODE == SCO_DEMO_MODE_MICROPHONE) +static int audio_output_paused = 0; static uint8_t audio_output_ring_buffer_storage[2*MSBC_PA_PREBUFFER_BYTES]; static btstack_ring_buffer_t audio_output_ring_buffer; +#endif + // input #if SCO_DEMO_MODE == SCO_DEMO_MODE_MICROPHONE @@ -182,6 +183,8 @@ static void sco_demo_msbc_fill_sine_audio_frame(void){ #endif #endif +#if (SCO_DEMO_MODE == SCO_DEMO_MODE_SINE) || (SCO_DEMO_MODE == SCO_DEMO_MODE_MICROPHONE) + static void playback_callback(int16_t * buffer, uint16_t num_samples){ // config based on codec @@ -263,9 +266,8 @@ static void audio_terminate(void){ audio->close(); } -#if (SCO_DEMO_MODE == SCO_DEMO_MODE_SINE) || (SCO_DEMO_MODE == SCO_DEMO_MODE_MICROPHONE) - #ifdef ENABLE_HFP_WIDE_BAND_SPEECH + static void handle_pcm_data(int16_t * data, int num_samples, int num_channels, int sample_rate, void * context){ UNUSED(context); UNUSED(sample_rate);