diff options
| author | Narr the Reg <juangerman-13@hotmail.com> | 2022-08-05 13:40:44 -0500 |
|---|---|---|
| committer | Narr the Reg <juangerman-13@hotmail.com> | 2022-08-05 17:20:05 -0500 |
| commit | 7cf52e6eb8b4d2c4ba629b10b620299c9bf6217b (patch) | |
| tree | 03bb83709e686fb315c397471d33d3b3554e5ec3 /src/core/hid/emulated_controller.cpp | |
| parent | 6907d1758dbc6eb2376699b9482659b885656b19 (diff) | |
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.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 8c3895937d..3552ad07c6 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" @@ -949,6 +950,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; |
