summaryrefslogtreecommitdiff
path: root/src/core/hid/emulated_controller.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2022-08-09 16:22:33 -0700
committerGravatar GitHub2022-08-09 16:22:33 -0700
commit23385032410fb6419752920ce4f85ccc847abd31 (patch)
tree58748cd69ba2ddc3c3839b70ceac5b1844641c39 /src/core/hid/emulated_controller.cpp
parentMerge pull request #8724 from german77/no_alpha (diff)
parenthid: core: Delay the stop vibration command when testing (diff)
downloadyuzu-23385032410fb6419752920ce4f85ccc847abd31.tar.gz
yuzu-23385032410fb6419752920ce4f85ccc847abd31.tar.xz
yuzu-23385032410fb6419752920ce4f85ccc847abd31.zip
Merge pull request #8722 from german77/ds4_goes_brrr
hid: core: Delay the stop vibration command when testing
Diffstat (limited to 'src/core/hid/emulated_controller.cpp')
-rw-r--r--src/core/hid/emulated_controller.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index 085ff3fda..049602e7d 100644
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -1,6 +1,7 @@
1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later 2// SPDX-License-Identifier: GPL-2.0-or-later
3 3
4#include "common/thread.h"
4#include "core/hid/emulated_controller.h" 5#include "core/hid/emulated_controller.h"
5#include "core/hid/input_converter.h" 6#include "core/hid/input_converter.h"
6 7
@@ -950,6 +951,9 @@ bool EmulatedController::TestVibration(std::size_t device_index) {
950 // Send a slight vibration to test for rumble support 951 // Send a slight vibration to test for rumble support
951 output_devices[device_index]->SetVibration(test_vibration); 952 output_devices[device_index]->SetVibration(test_vibration);
952 953
954 // Wait for about 15ms to ensure the controller is ready for the stop command
955 std::this_thread::sleep_for(std::chrono::milliseconds(15));
956
953 // Stop any vibration and return the result 957 // Stop any vibration and return the result
954 return output_devices[device_index]->SetVibration(zero_vibration) == 958 return output_devices[device_index]->SetVibration(zero_vibration) ==
955 Common::Input::VibrationError::None; 959 Common::Input::VibrationError::None;