summaryrefslogtreecommitdiff
path: root/src/core/hid/emulated_controller.cpp
diff options
context:
space:
mode:
authorGravatar Narr the Reg2022-08-05 13:40:44 -0500
committerGravatar Narr the Reg2022-08-05 17:20:05 -0500
commit80b462e553ed3a5cee2c5a86244937f94fd2513f (patch)
tree03bb83709e686fb315c397471d33d3b3554e5ec3 /src/core/hid/emulated_controller.cpp
parentController bugfixes in profile select (#8716) (diff)
downloadyuzu-80b462e553ed3a5cee2c5a86244937f94fd2513f.tar.gz
yuzu-80b462e553ed3a5cee2c5a86244937f94fd2513f.tar.xz
yuzu-80b462e553ed3a5cee2c5a86244937f94fd2513f.zip
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 8c3895937..3552ad07c 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
@@ -949,6 +950,9 @@ bool EmulatedController::TestVibration(std::size_t device_index) {
949 // Send a slight vibration to test for rumble support 950 // Send a slight vibration to test for rumble support
950 output_devices[device_index]->SetVibration(test_vibration); 951 output_devices[device_index]->SetVibration(test_vibration);
951 952
953 // Wait for about 15ms to ensure the controller is ready for the stop command
954 std::this_thread::sleep_for(std::chrono::milliseconds(15));
955
952 // Stop any vibration and return the result 956 // Stop any vibration and return the result
953 return output_devices[device_index]->SetVibration(zero_vibration) == 957 return output_devices[device_index]->SetVibration(zero_vibration) ==
954 Common::Input::VibrationError::None; 958 Common::Input::VibrationError::None;