mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Removed diasble scan and increased counter
This commit is contained in:
parent
155c06b83f
commit
c6795d10e2
1 changed files with 5 additions and 14 deletions
19
BTD.cpp
19
BTD.cpp
|
@ -497,6 +497,7 @@ void BTD::HCI_task() {
|
|||
case HCI_RESET_STATE:
|
||||
hci_counter++;
|
||||
if (hci_cmd_complete) {
|
||||
hci_counter = 0;
|
||||
#ifdef DEBUG
|
||||
Notify(PSTR("\r\nHCI Reset complete"));
|
||||
#endif
|
||||
|
@ -661,27 +662,17 @@ void BTD::HCI_task() {
|
|||
}
|
||||
PrintHex<uint8_t>(disc_bdaddr[0]);
|
||||
#endif
|
||||
hci_write_scan_disable();
|
||||
hci_state = HCI_DISABLE_SCAN_STATE;
|
||||
}
|
||||
break;
|
||||
|
||||
case HCI_DISABLE_SCAN_STATE:
|
||||
if (hci_cmd_complete) {
|
||||
#ifdef DEBUG
|
||||
Notify(PSTR("\r\nScan Disabled"));
|
||||
#endif
|
||||
l2capConnectionClaimed = false;
|
||||
hci_event_flag = 0;
|
||||
hci_state = HCI_DONE_STATE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case HCI_DONE_STATE:
|
||||
hci_counter++;
|
||||
if (hci_counter > 250) { // Wait until we have looped 250 times to make sure that the L2CAP connection has been started
|
||||
if (hci_counter > 1000) { // Wait until we have looped 1000 times to make sure that the L2CAP connection has been started
|
||||
hci_counter = 0;
|
||||
hci_state = HCI_SCANNING_STATE;
|
||||
l2capConnectionClaimed = false;
|
||||
hci_state = HCI_SCANNING_STATE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in a new issue