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
15
BTD.cpp
15
BTD.cpp
|
@ -497,6 +497,7 @@ void BTD::HCI_task() {
|
||||||
case HCI_RESET_STATE:
|
case HCI_RESET_STATE:
|
||||||
hci_counter++;
|
hci_counter++;
|
||||||
if (hci_cmd_complete) {
|
if (hci_cmd_complete) {
|
||||||
|
hci_counter = 0;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
Notify(PSTR("\r\nHCI Reset complete"));
|
Notify(PSTR("\r\nHCI Reset complete"));
|
||||||
#endif
|
#endif
|
||||||
|
@ -661,16 +662,7 @@ void BTD::HCI_task() {
|
||||||
}
|
}
|
||||||
PrintHex<uint8_t>(disc_bdaddr[0]);
|
PrintHex<uint8_t>(disc_bdaddr[0]);
|
||||||
#endif
|
#endif
|
||||||
hci_write_scan_disable();
|
l2capConnectionClaimed = false;
|
||||||
hci_state = HCI_DISABLE_SCAN_STATE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case HCI_DISABLE_SCAN_STATE:
|
|
||||||
if (hci_cmd_complete) {
|
|
||||||
#ifdef DEBUG
|
|
||||||
Notify(PSTR("\r\nScan Disabled"));
|
|
||||||
#endif
|
|
||||||
hci_event_flag = 0;
|
hci_event_flag = 0;
|
||||||
hci_state = HCI_DONE_STATE;
|
hci_state = HCI_DONE_STATE;
|
||||||
}
|
}
|
||||||
|
@ -678,10 +670,9 @@ void BTD::HCI_task() {
|
||||||
|
|
||||||
case HCI_DONE_STATE:
|
case HCI_DONE_STATE:
|
||||||
hci_counter++;
|
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_counter = 0;
|
||||||
hci_state = HCI_SCANNING_STATE;
|
hci_state = HCI_SCANNING_STATE;
|
||||||
l2capConnectionClaimed = false;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue