From 17cd946e873740bab518cb1be3c31fa423736852 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Sat, 23 Jul 2016 16:40:17 +0200 Subject: [PATCH 1/2] sco_util: simplify double #ifdefs --- example/sco_demo_util.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/example/sco_demo_util.c b/example/sco_demo_util.c index 305060810..9724daa92 100644 --- a/example/sco_demo_util.c +++ b/example/sco_demo_util.c @@ -293,21 +293,13 @@ void sco_demo_set_codec(uint8_t codec){ if (negotiated_codec == codec) return; negotiated_codec = codec; #if SCO_DEMO_MODE == SCO_DEMO_MODE_SINE -#ifdef SCO_WAV_FILENAME +#if defined(SCO_WAV_FILENAME) || defined(SCO_SBC_FILENAME) if (negotiated_codec == HFP_CODEC_MSBC){ sco_demo_init_mSBC(); } else { sco_demo_init_CVSD(); } #endif -#ifdef SCO_SBC_FILENAME - if (negotiated_codec == HFP_CODEC_MSBC){ - sco_demo_init_mSBC(); - } else { - sco_demo_init_CVSD(); - } -#endif - #endif } From bd1920a3cca67680da0de3788427ca0f57ef31c5 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Sat, 23 Jul 2016 16:50:42 +0200 Subject: [PATCH 2/2] sco_util: read sco packet status flag correctly --- example/sco_demo_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/sco_demo_util.c b/example/sco_demo_util.c index 9724daa92..cfdfc6f13 100644 --- a/example/sco_demo_util.c +++ b/example/sco_demo_util.c @@ -242,7 +242,7 @@ static void sco_demo_init_CVSD(void){ static void sco_demo_receive_mSBC(uint8_t * packet, uint16_t size){ if (num_samples_to_write){ - sbc_decoder_process_data(&decoder_state, packet[2], packet+3, size-3); + sbc_decoder_process_data(&decoder_state, (packet[1] >> 4) & 3, packet+3, size-3); dump_data = 0; } }