From 31951e85ff33fec64baf07514dbe66e27eb40aa0 Mon Sep 17 00:00:00 2001 From: Kristian Lauszus Date: Sun, 24 Nov 2013 16:54:42 +0100 Subject: [PATCH] Decreased delay between commands --- PS3BT.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PS3BT.cpp b/PS3BT.cpp index 976b21b5..9ed5da75 100644 --- a/PS3BT.cpp +++ b/PS3BT.cpp @@ -535,8 +535,8 @@ void PS3BT::Run() { // Playstation Sixaxis Dualshock and Navigation Controller commands void PS3BT::HID_Command(uint8_t* data, uint8_t nbytes) { - if (millis() - timerHID <= 250) // Check if is has been more than 250ms since last command - delay((uint32_t)(250 - (millis() - timerHID))); // There have to be a delay between commands + if (millis() - timerHID <= 150) // Check if is has been more than 150ms since last command + delay((uint32_t)(150 - (millis() - timerHID))); // There have to be a delay between commands pBtd->L2CAP_Command(hci_handle, data, nbytes, control_scid[0], control_scid[1]); // Both the Navigation and Dualshock controller sends data via the control channel timerHID = millis(); } @@ -613,8 +613,8 @@ void PS3BT::enable_sixaxis() { // Command used to enable the Dualshock 3 and Nav // Playstation Move Controller commands void PS3BT::HIDMove_Command(uint8_t* data, uint8_t nbytes) { - if (millis() - timerHID <= 250)// Check if is has been less than 200ms since last command - delay((uint32_t)(250 - (millis() - timerHID))); //There have to be a delay between commands + if (millis() - timerHID <= 150)// Check if is has been less than 150ms since last command + delay((uint32_t)(150 - (millis() - timerHID))); // There have to be a delay between commands pBtd->L2CAP_Command(hci_handle, data, nbytes, interrupt_scid[0], interrupt_scid[1]); // The Move controller sends it's data via the intterrupt channel timerHID = millis(); }