mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-14 03:29:59 +00:00
Merge pull request #8722 from german77/ds4_goes_brrr
hid: core: Delay the stop vibration command when testing
This commit is contained in:
commit
2338503241
1 changed files with 4 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "common/thread.h"
|
||||||
#include "core/hid/emulated_controller.h"
|
#include "core/hid/emulated_controller.h"
|
||||||
#include "core/hid/input_converter.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
|
// Send a slight vibration to test for rumble support
|
||||||
output_devices[device_index]->SetVibration(test_vibration);
|
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
|
// Stop any vibration and return the result
|
||||||
return output_devices[device_index]->SetVibration(zero_vibration) ==
|
return output_devices[device_index]->SetVibration(zero_vibration) ==
|
||||||
Common::Input::VibrationError::None;
|
Common::Input::VibrationError::None;
|
||||||
|
|
Loading…
Reference in a new issue