From 49707916db500e8225676a4caa4109f69d25faf3 Mon Sep 17 00:00:00 2001 From: Narr the Reg Date: Thu, 26 Jan 2023 11:21:04 -0600 Subject: input_common: Implement SetLowPowerMode and TriggersElapsed for the joycon driver --- .../helpers/joycon_protocol/generic_functions.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/input_common/helpers/joycon_protocol/generic_functions.cpp') 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() { return SetReportMode(ReportMode::STANDARD_FULL_60HZ); } +DriverResult GenericProtocol::SetLowPowerMode(bool enable) { + ScopedSetBlocking sb(this); + const std::array buffer{static_cast(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 output; -- cgit v1.2.3