summaryrefslogtreecommitdiffstats
path: root/src/input_common/helpers/joycon_protocol/generic_functions.cpp
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2022-12-23 15:32:02 +0100
committerNarr the Reg <juangerman-13@hotmail.com>2023-01-20 01:05:22 +0100
commite1a3bda4d9881cb99c36b64733b814a3bb437f13 (patch)
treea9c0d864b023a810f48c129bb8bd6e84afb2ed2b /src/input_common/helpers/joycon_protocol/generic_functions.cpp
parentcore: hid: Fix input regressions (diff)
downloadyuzu-e1a3bda4d9881cb99c36b64733b814a3bb437f13.tar
yuzu-e1a3bda4d9881cb99c36b64733b814a3bb437f13.tar.gz
yuzu-e1a3bda4d9881cb99c36b64733b814a3bb437f13.tar.bz2
yuzu-e1a3bda4d9881cb99c36b64733b814a3bb437f13.tar.lz
yuzu-e1a3bda4d9881cb99c36b64733b814a3bb437f13.tar.xz
yuzu-e1a3bda4d9881cb99c36b64733b814a3bb437f13.tar.zst
yuzu-e1a3bda4d9881cb99c36b64733b814a3bb437f13.zip
Diffstat (limited to '')
-rw-r--r--src/input_common/helpers/joycon_protocol/generic_functions.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/input_common/helpers/joycon_protocol/generic_functions.cpp b/src/input_common/helpers/joycon_protocol/generic_functions.cpp
index 829f7625d..cbd9ff4f8 100644
--- a/src/input_common/helpers/joycon_protocol/generic_functions.cpp
+++ b/src/input_common/helpers/joycon_protocol/generic_functions.cpp
@@ -7,7 +7,7 @@
namespace InputCommon::Joycon {
GenericProtocol::GenericProtocol(std::shared_ptr<JoyconHandle> handle)
- : JoyconCommonProtocol(handle) {}
+ : JoyconCommonProtocol(std::move(handle)) {}
DriverResult GenericProtocol::EnablePassiveMode() {
SetBlocking();
@@ -43,7 +43,7 @@ DriverResult GenericProtocol::GetControllerType(ControllerType& controller_type)
}
DriverResult GenericProtocol::EnableImu(bool enable) {
- const std::vector<u8> buffer{static_cast<u8>(enable ? 1 : 0)};
+ const std::array<u8, 1> buffer{static_cast<u8>(enable ? 1 : 0)};
std::vector<u8> output;
SetBlocking();
const auto result = SendSubCommand(SubCommand::ENABLE_IMU, buffer, output);
@@ -54,8 +54,8 @@ DriverResult GenericProtocol::EnableImu(bool enable) {
DriverResult GenericProtocol::SetImuConfig(GyroSensitivity gsen, GyroPerformance gfrec,
AccelerometerSensitivity asen,
AccelerometerPerformance afrec) {
- const std::vector<u8> buffer{static_cast<u8>(gsen), static_cast<u8>(asen),
- static_cast<u8>(gfrec), static_cast<u8>(afrec)};
+ const std::array<u8, 4> buffer{static_cast<u8>(gsen), static_cast<u8>(asen),
+ static_cast<u8>(gfrec), static_cast<u8>(afrec)};
std::vector<u8> output;
SetBlocking();
const auto result = SendSubCommand(SubCommand::SET_IMU_SENSITIVITY, buffer, output);
@@ -115,7 +115,7 @@ DriverResult GenericProtocol::GetVersionNumber(FirmwareVersion& version) {
}
DriverResult GenericProtocol::SetHomeLight() {
- const std::vector<u8> buffer{0x0f, 0xf0, 0x00};
+ static constexpr std::array<u8, 3> buffer{0x0f, 0xf0, 0x00};
std::vector<u8> output;
SetBlocking();
@@ -130,7 +130,7 @@ DriverResult GenericProtocol::SetLedBusy() {
}
DriverResult GenericProtocol::SetLedPattern(u8 leds) {
- const std::vector<u8> buffer{leds};
+ const std::array<u8, 1> buffer{leds};
std::vector<u8> output;
SetBlocking();