diff options
Diffstat (limited to 'src/input_common/helpers/joycon_protocol/generic_functions.cpp')
| -rw-r--r-- | src/input_common/helpers/joycon_protocol/generic_functions.cpp | 12 |
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 @@ | |||
| 7 | namespace InputCommon::Joycon { | 7 | namespace InputCommon::Joycon { |
| 8 | 8 | ||
| 9 | GenericProtocol::GenericProtocol(std::shared_ptr<JoyconHandle> handle) | 9 | GenericProtocol::GenericProtocol(std::shared_ptr<JoyconHandle> handle) |
| 10 | : JoyconCommonProtocol(handle) {} | 10 | : JoyconCommonProtocol(std::move(handle)) {} |
| 11 | 11 | ||
| 12 | DriverResult GenericProtocol::EnablePassiveMode() { | 12 | DriverResult GenericProtocol::EnablePassiveMode() { |
| 13 | SetBlocking(); | 13 | SetBlocking(); |
| @@ -43,7 +43,7 @@ DriverResult GenericProtocol::GetControllerType(ControllerType& controller_type) | |||
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | DriverResult GenericProtocol::EnableImu(bool enable) { | 45 | DriverResult GenericProtocol::EnableImu(bool enable) { |
| 46 | const std::vector<u8> buffer{static_cast<u8>(enable ? 1 : 0)}; | 46 | const std::array<u8, 1> buffer{static_cast<u8>(enable ? 1 : 0)}; |
| 47 | std::vector<u8> output; | 47 | std::vector<u8> output; |
| 48 | SetBlocking(); | 48 | SetBlocking(); |
| 49 | const auto result = SendSubCommand(SubCommand::ENABLE_IMU, buffer, output); | 49 | const auto result = SendSubCommand(SubCommand::ENABLE_IMU, buffer, output); |
| @@ -54,8 +54,8 @@ DriverResult GenericProtocol::EnableImu(bool enable) { | |||
| 54 | DriverResult GenericProtocol::SetImuConfig(GyroSensitivity gsen, GyroPerformance gfrec, | 54 | DriverResult GenericProtocol::SetImuConfig(GyroSensitivity gsen, GyroPerformance gfrec, |
| 55 | AccelerometerSensitivity asen, | 55 | AccelerometerSensitivity asen, |
| 56 | AccelerometerPerformance afrec) { | 56 | AccelerometerPerformance afrec) { |
| 57 | const std::vector<u8> buffer{static_cast<u8>(gsen), static_cast<u8>(asen), | 57 | const std::array<u8, 4> buffer{static_cast<u8>(gsen), static_cast<u8>(asen), |
| 58 | static_cast<u8>(gfrec), static_cast<u8>(afrec)}; | 58 | static_cast<u8>(gfrec), static_cast<u8>(afrec)}; |
| 59 | std::vector<u8> output; | 59 | std::vector<u8> output; |
| 60 | SetBlocking(); | 60 | SetBlocking(); |
| 61 | const auto result = SendSubCommand(SubCommand::SET_IMU_SENSITIVITY, buffer, output); | 61 | const auto result = SendSubCommand(SubCommand::SET_IMU_SENSITIVITY, buffer, output); |
| @@ -115,7 +115,7 @@ DriverResult GenericProtocol::GetVersionNumber(FirmwareVersion& version) { | |||
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | DriverResult GenericProtocol::SetHomeLight() { | 117 | DriverResult GenericProtocol::SetHomeLight() { |
| 118 | const std::vector<u8> buffer{0x0f, 0xf0, 0x00}; | 118 | static constexpr std::array<u8, 3> buffer{0x0f, 0xf0, 0x00}; |
| 119 | std::vector<u8> output; | 119 | std::vector<u8> output; |
| 120 | SetBlocking(); | 120 | SetBlocking(); |
| 121 | 121 | ||
| @@ -130,7 +130,7 @@ DriverResult GenericProtocol::SetLedBusy() { | |||
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | DriverResult GenericProtocol::SetLedPattern(u8 leds) { | 132 | DriverResult GenericProtocol::SetLedPattern(u8 leds) { |
| 133 | const std::vector<u8> buffer{leds}; | 133 | const std::array<u8, 1> buffer{leds}; |
| 134 | std::vector<u8> output; | 134 | std::vector<u8> output; |
| 135 | SetBlocking(); | 135 | SetBlocking(); |
| 136 | 136 | ||