From fc9abd3c625c3eb8b7cc9445eef1291744ee52f6 Mon Sep 17 00:00:00 2001 From: german77 Date: Wed, 16 Jun 2021 22:09:38 -0500 Subject: nfp: Improve implementation --- src/core/hid/emulated_controller.cpp | 6 ++++++ src/core/hid/emulated_controller.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'src/core/hid') diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index a7cdf45e6..61ceea629 100644 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp @@ -884,6 +884,12 @@ bool EmulatedController::TestVibration(std::size_t device_index) { return SetVibration(device_index, DEFAULT_VIBRATION_VALUE); } +bool EmulatedController::SetPollingMode(Common::Input::PollingMode polling_mode) { + LOG_INFO(Service_HID, "Set polling mode {}", polling_mode); + auto& output_device = output_devices[static_cast(DeviceIndex::Right)]; + return output_device->SetPollingMode(polling_mode) == Common::Input::PollingError::None; +} + void EmulatedController::SetLedPattern() { for (auto& device : output_devices) { if (!device) { diff --git a/src/core/hid/emulated_controller.h b/src/core/hid/emulated_controller.h index d8642c5b3..7785e6110 100644 --- a/src/core/hid/emulated_controller.h +++ b/src/core/hid/emulated_controller.h @@ -309,6 +309,8 @@ public: */ bool TestVibration(std::size_t device_index); + bool SetPollingMode(Common::Input::PollingMode polling_mode); + /// Returns the led pattern corresponding to this emulated controller LedPattern GetLedPattern() const; -- cgit v1.2.3