summaryrefslogtreecommitdiffstats
path: root/src/core/hid
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-08-10 01:22:33 +0200
committerGitHub <noreply@github.com>2022-08-10 01:22:33 +0200
commit23385032410fb6419752920ce4f85ccc847abd31 (patch)
tree58748cd69ba2ddc3c3839b70ceac5b1844641c39 /src/core/hid
parentMerge pull request #8724 from german77/no_alpha (diff)
parenthid: core: Delay the stop vibration command when testing (diff)
downloadyuzu-23385032410fb6419752920ce4f85ccc847abd31.tar
yuzu-23385032410fb6419752920ce4f85ccc847abd31.tar.gz
yuzu-23385032410fb6419752920ce4f85ccc847abd31.tar.bz2
yuzu-23385032410fb6419752920ce4f85ccc847abd31.tar.lz
yuzu-23385032410fb6419752920ce4f85ccc847abd31.tar.xz
yuzu-23385032410fb6419752920ce4f85ccc847abd31.tar.zst
yuzu-23385032410fb6419752920ce4f85ccc847abd31.zip
Diffstat (limited to 'src/core/hid')
-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 @@
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
+#include "common/thread.h"
#include "core/hid/emulated_controller.h"
#include "core/hid/input_converter.h"
@@ -950,6 +951,9 @@ bool EmulatedController::TestVibration(std::size_t device_index) {
// Send a slight vibration to test for rumble support
output_devices[device_index]->SetVibration(test_vibration);
+ // Wait for about 15ms to ensure the controller is ready for the stop command
+ std::this_thread::sleep_for(std::chrono::milliseconds(15));
+
// Stop any vibration and return the result
return output_devices[device_index]->SetVibration(zero_vibration) ==
Common::Input::VibrationError::None;