Commit 305882ac3fccc26ceccc9f3f0e2e4df6b344feac
1 parent
6376da04
fix(change mode):increase delay to wait bt ativity stop
Showing
3 changed files
with
22 additions
and
6 deletions
| ... | ... | @@ -590,7 +590,7 @@ U8 app_nav_media_finish(void) |
| 590 | 590 | |
| 591 | 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 | 595 | bt_hci_flush(); |
| 596 | 596 | delayms(200); | ... | ... |
| ... | ... | @@ -589,6 +589,8 @@ void csbm_put_tx_unencoded_data(short *ptr,U16 len) |
| 589 | 589 | #endif |
| 590 | 590 | } |
| 591 | 591 | |
| 592 | + | |
| 593 | +/* note that this function only run in keyfunction task */ | |
| 592 | 594 | void app_optek_link_role_sw(void) |
| 593 | 595 | { |
| 594 | 596 | if (app_main_data.share_link_role == SL_ROLE_SLAVE) |
| ... | ... | @@ -597,17 +599,31 @@ void app_optek_link_role_sw(void) |
| 597 | 599 | app_dac_receive_pcm_enable(FALSE); |
| 598 | 600 | app_nav_bt_codec_reinit(); |
| 599 | 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 | 605 | else if (app_main_data.share_link_role == SL_ROLE_MASTER) |
| 605 | 606 | { |
| 606 | 607 | optek_link_role_stop(); |
| 607 | 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 | 625 | bt_flash_set_multi_room_role(SL_ROLE_SLAVE); |
| 626 | + } | |
| 611 | 627 | |
| 612 | 628 | //watchdog reset |
| 613 | 629 | TX_DISABLE; |
| ... | ... | @@ -1477,7 +1493,7 @@ void optek_link_role_stop(void) |
| 1477 | 1493 | DBG_Printf("optek_link_role_stop\n\r"); |
| 1478 | 1494 | kBtHCI_optek_link_enable(0, OPTEK_LINK_H1); |
| 1479 | 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