Commit 305882ac3fccc26ceccc9f3f0e2e4df6b344feac

Authored by LuoZheSi
1 parent 6376da04

fix(change mode):increase delay to wait bt ativity stop

@@ -590,7 +590,7 @@ U8 app_nav_media_finish(void) @@ -590,7 +590,7 @@ U8 app_nav_media_finish(void)
590 590
591 if (hci_A2DP_conn_present() == TRUE) 591 if (hci_A2DP_conn_present() == TRUE)
592 { 592 {
593 - app_main_data.media = MEDIA_UNKNOWN; //when finish, not BtHCI_disconn() discover and page on 593 + //app_main_data.media = MEDIA_UNKNOWN; //when finish, not BtHCI_disconn() discover and page on
594 594
595 bt_hci_flush(); 595 bt_hci_flush();
596 delayms(200); 596 delayms(200);
@@ -121,7 +121,7 @@ @@ -121,7 +121,7 @@
121 #define BT_PA_ENABLE 121 #define BT_PA_ENABLE
122 122
123 /***********************OPTEK LINK 2.0******************************/ 123 /***********************OPTEK LINK 2.0******************************/
124 -//#define OPTEK_LINK_ENABLE 124 +#define OPTEK_LINK_ENABLE
125 125
126 #ifdef OPTEK_LINK_ENABLE 126 #ifdef OPTEK_LINK_ENABLE
127 127
@@ -589,6 +589,8 @@ void csbm_put_tx_unencoded_data(short *ptr,U16 len) @@ -589,6 +589,8 @@ void csbm_put_tx_unencoded_data(short *ptr,U16 len)
589 #endif 589 #endif
590 } 590 }
591 591
  592 +
  593 +/* note that this function only run in keyfunction task */
592 void app_optek_link_role_sw(void) 594 void app_optek_link_role_sw(void)
593 { 595 {
594 if (app_main_data.share_link_role == SL_ROLE_SLAVE) 596 if (app_main_data.share_link_role == SL_ROLE_SLAVE)
@@ -597,17 +599,31 @@ void app_optek_link_role_sw(void) @@ -597,17 +599,31 @@ void app_optek_link_role_sw(void)
597 app_dac_receive_pcm_enable(FALSE); 599 app_dac_receive_pcm_enable(FALSE);
598 app_nav_bt_codec_reinit(); 600 app_nav_bt_codec_reinit();
599 optek_link_role_stop(); 601 optek_link_role_stop();
600 - //app_bt_conn_code_text_copy();  
601 602
602 - bt_flash_set_multi_room_role(SL_ROLE_MASTER); 603 + bt_flash_set_multi_room_role(SL_ROLE_BT);
603 } 604 }
604 else if (app_main_data.share_link_role == SL_ROLE_MASTER) 605 else if (app_main_data.share_link_role == SL_ROLE_MASTER)
605 { 606 {
606 optek_link_role_stop(); 607 optek_link_role_stop();
607 bt_flash_set_multi_room_role(SL_ROLE_SLAVE); 608 bt_flash_set_multi_room_role(SL_ROLE_SLAVE);
608 } 609 }
609 - else 610 + else if (app_main_data.share_link_role == SL_ROLE_BT)
  611 + {
  612 + if (hci_A2DP_conn_present() == TRUE)
  613 + {
  614 + bt_hci_flush();
  615 + delayms(200);
  616 + }
  617 +
  618 + app_bt_set_scan_enable_mode(enBT_BOTH_SCAN_DISABLE);
  619 + delayms(100);
  620 +
  621 + bt_flash_set_multi_room_role(SL_ROLE_SLAVE);
  622 + }
  623 + else
  624 + {
610 bt_flash_set_multi_room_role(SL_ROLE_SLAVE); 625 bt_flash_set_multi_room_role(SL_ROLE_SLAVE);
  626 + }
611 627
612 //watchdog reset 628 //watchdog reset
613 TX_DISABLE; 629 TX_DISABLE;
@@ -1477,7 +1493,7 @@ void optek_link_role_stop(void) @@ -1477,7 +1493,7 @@ void optek_link_role_stop(void)
1477 DBG_Printf("optek_link_role_stop\n\r"); 1493 DBG_Printf("optek_link_role_stop\n\r");
1478 kBtHCI_optek_link_enable(0, OPTEK_LINK_H1); 1494 kBtHCI_optek_link_enable(0, OPTEK_LINK_H1);
1479 optek_link_enable = FALSE; 1495 optek_link_enable = FALSE;
1480 - delayms(50); 1496 + delayms(100);//wait stop complete
1481 } 1497 }
1482 } 1498 }
1483 1499
Please register or login to post a comment