diff options
| author | bunnei <bunneidev@gmail.com> | 2023-01-26 10:56:31 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-26 10:56:31 -0800 |
| commit | bfe5129779d81c34fe1e3a6cebf6db203b1b6ae2 (patch) | |
| tree | 96c6269e01338fe630d03af62ccbd983632bce0c /src/input_common/helpers/joycon_protocol/generic_functions.cpp | |
| parent | 7c607953e54d7f1a6e3e74e86342ce8321cb1e32 (diff) | |
| parent | 8666d84926e21d3de6f264671c65dc4af1a2f909 (diff) | |
Merge pull request #9683 from german77/high_power_joycon
input_common: Implement SetLowPowerMode and TriggersElapsed
Diffstat (limited to 'src/input_common/helpers/joycon_protocol/generic_functions.cpp')
| -rw-r--r-- | src/input_common/helpers/joycon_protocol/generic_functions.cpp | 11 |
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 52bb8b61aa..63cfb13690 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() { return SetReportMode(ReportMode::STANDARD_FULL_60HZ); } +DriverResult GenericProtocol::SetLowPowerMode(bool enable) { + ScopedSetBlocking sb(this); + const std::array<u8, 1> buffer{static_cast<u8>(enable ? 1 : 0)}; + return SendSubCommand(SubCommand::LOW_POWER_MODE, buffer); +} + +DriverResult GenericProtocol::TriggersElapsed() { + ScopedSetBlocking sb(this); + return SendSubCommand(SubCommand::TRIGGERS_ELAPSED, {}); +} + DriverResult GenericProtocol::GetDeviceInfo(DeviceInfo& device_info) { ScopedSetBlocking sb(this); std::vector<u8> output; |
