From b957f5f4dc4b4f8ebd292462d0a89d3f3700c5a8 Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Mon, 15 Jul 2013 19:34:56 +0200 Subject: [PATCH] Added delay after setting address --- BTD.cpp | 6 ++++-- PS3USB.cpp | 2 ++ XBOXRECV.cpp | 2 ++ XBOXUSB.cpp | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/BTD.cpp b/BTD.cpp index dbb784b2..703da2b2 100755 --- a/BTD.cpp +++ b/BTD.cpp @@ -115,14 +115,16 @@ uint8_t BTD::Init(uint8_t parent, uint8_t port, bool lowspeed) { bAddress = 0; #ifdef DEBUG_USB_HOST Notify(PSTR("\r\nsetAddr: "), 0x80); -#endif D_PrintHex (rcode, 0x80); +#endif return rcode; } #ifdef EXTRADEBUG Notify(PSTR("\r\nAddr: "), 0x80); D_PrintHex (bAddress, 0x80); #endif + delay(300); // Spec says you should wait at least 200ms + p->lowspeed = false; //get pointer to assigned address record @@ -157,7 +159,7 @@ uint8_t BTD::Init(uint8_t parent, uint8_t port, bool lowspeed) { if (my_bdaddr[0] == 0x00 && my_bdaddr[1] == 0x00 && my_bdaddr[2] == 0x00 && my_bdaddr[3] == 0x00 && my_bdaddr[4] == 0x00 && my_bdaddr[5] == 0x00) { #ifdef DEBUG_USB_HOST - Notify(PSTR("\r\nPlease plug in the dongle before trying to pair with the PS3 Controller\n\rOr set the Bluetooth address in the constructor of the PS3BT class"), 0x80); + Notify(PSTR("\r\nPlease plug in the dongle before trying to pair with the PS3 Controller\n\ror set the Bluetooth address in the constructor of the PS3BT class"), 0x80); #endif } else { if (PID == PS3_PID || PID == PS3NAVIGATION_PID) diff --git a/PS3USB.cpp b/PS3USB.cpp index 8882c92c..d1e6d157 100644 --- a/PS3USB.cpp +++ b/PS3USB.cpp @@ -128,6 +128,8 @@ uint8_t PS3USB::Init(uint8_t parent, uint8_t port, bool lowspeed) { Notify(PSTR("\r\nAddr: "), 0x80); D_PrintHex (bAddress, 0x80); #endif + delay(300); // Spec says you should wait at least 200ms + p->lowspeed = false; //get pointer to assigned address record diff --git a/XBOXRECV.cpp b/XBOXRECV.cpp index 56dbe567..34cba4b0 100644 --- a/XBOXRECV.cpp +++ b/XBOXRECV.cpp @@ -128,6 +128,8 @@ uint8_t XBOXRECV::Init(uint8_t parent, uint8_t port, bool lowspeed) { Notify(PSTR("\r\nAddr: "), 0x80); D_PrintHex (bAddress, 0x80); #endif + delay(300); // Spec says you should wait at least 200ms + p->lowspeed = false; //get pointer to assigned address record diff --git a/XBOXUSB.cpp b/XBOXUSB.cpp index e79c8a15..2692ffd1 100644 --- a/XBOXUSB.cpp +++ b/XBOXUSB.cpp @@ -131,6 +131,8 @@ uint8_t XBOXUSB::Init(uint8_t parent, uint8_t port, bool lowspeed) { Notify(PSTR("\r\nAddr: "), 0x80); D_PrintHex (bAddress, 0x80); #endif + delay(300); // Spec says you should wait at least 200ms + p->lowspeed = false; //get pointer to assigned address record