summaryrefslogtreecommitdiff
path: root/src/input_common/helpers/joycon_protocol/generic_functions.cpp
diff options
context:
space:
mode:
authorGravatar Narr the Reg2023-01-26 11:21:04 -0600
committerGravatar Narr the Reg2023-01-26 11:21:04 -0600
commit49707916db500e8225676a4caa4109f69d25faf3 (patch)
tree83aa03583c1a62fe0e86bfdb44e9e11b7d480a0d /src/input_common/helpers/joycon_protocol/generic_functions.cpp
parentRevert 9617 and fix it on input_common (diff)
downloadyuzu-49707916db500e8225676a4caa4109f69d25faf3.tar.gz
yuzu-49707916db500e8225676a4caa4109f69d25faf3.tar.xz
yuzu-49707916db500e8225676a4caa4109f69d25faf3.zip
input_common: Implement SetLowPowerMode and TriggersElapsed for the joycon driver
Diffstat (limited to 'src/input_common/helpers/joycon_protocol/generic_functions.cpp')
-rw-r--r--src/input_common/helpers/joycon_protocol/generic_functions.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/input_common/helpers/joycon_protocol/generic_functions.cpp b/src/input_common/helpers/joycon_protocol/generic_functions.cpp
index 52bb8b61a..63cfb1369 100644
--- a/src/input_common/helpers/joycon_protocol/generic_functions.cpp
+++ b/src/input_common/helpers/joycon_protocol/generic_functions.cpp
@@ -19,6 +19,17 @@ DriverResult GenericProtocol::EnableActiveMode() {
19 return SetReportMode(ReportMode::STANDARD_FULL_60HZ); 19 return SetReportMode(ReportMode::STANDARD_FULL_60HZ);
20} 20}
21 21
22DriverResult GenericProtocol::SetLowPowerMode(bool enable) {
23 ScopedSetBlocking sb(this);
24 const std::array<u8, 1> buffer{static_cast<u8>(enable ? 1 : 0)};
25 return SendSubCommand(SubCommand::LOW_POWER_MODE, buffer);
26}
27
28DriverResult GenericProtocol::TriggersElapsed() {
29 ScopedSetBlocking sb(this);
30 return SendSubCommand(SubCommand::TRIGGERS_ELAPSED, {});
31}
32
22DriverResult GenericProtocol::GetDeviceInfo(DeviceInfo& device_info) { 33DriverResult GenericProtocol::GetDeviceInfo(DeviceInfo& device_info) {
23 ScopedSetBlocking sb(this); 34 ScopedSetBlocking sb(this);
24 std::vector<u8> output; 35 std::vector<u8> output;