diff options
| author | 2022-12-28 15:21:12 -0600 | |
|---|---|---|
| committer | 2023-01-19 18:05:22 -0600 | |
| commit | 459fb2b21337bae60194a2a99ce68c87aaed522d (patch) | |
| tree | a7522832fa60f283e076df34c85380c5d4bc49d3 /src/input_common/helpers/joycon_protocol/common_protocol.cpp | |
| parent | yuzu: Add ring controller test button (diff) | |
| download | yuzu-459fb2b21337bae60194a2a99ce68c87aaed522d.tar.gz yuzu-459fb2b21337bae60194a2a99ce68c87aaed522d.tar.xz yuzu-459fb2b21337bae60194a2a99ce68c87aaed522d.zip | |
input_common: Implement joycon ir camera
Diffstat (limited to 'src/input_common/helpers/joycon_protocol/common_protocol.cpp')
| -rw-r--r-- | src/input_common/helpers/joycon_protocol/common_protocol.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/input_common/helpers/joycon_protocol/common_protocol.cpp b/src/input_common/helpers/joycon_protocol/common_protocol.cpp index a4d08fdaf..a329db107 100644 --- a/src/input_common/helpers/joycon_protocol/common_protocol.cpp +++ b/src/input_common/helpers/joycon_protocol/common_protocol.cpp | |||
| @@ -120,6 +120,19 @@ DriverResult JoyconCommonProtocol::SendSubCommand(SubCommand sc, std::span<const | |||
| 120 | return DriverResult::Success; | 120 | return DriverResult::Success; |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | DriverResult JoyconCommonProtocol::SendMcuCommand(SubCommand sc, std::span<const u8> buffer) { | ||
| 124 | std::vector<u8> local_buffer(MaxResponseSize); | ||
| 125 | |||
| 126 | local_buffer[0] = static_cast<u8>(OutputReport::MCU_DATA); | ||
| 127 | local_buffer[1] = GetCounter(); | ||
| 128 | local_buffer[10] = static_cast<u8>(sc); | ||
| 129 | for (std::size_t i = 0; i < buffer.size(); ++i) { | ||
| 130 | local_buffer[11 + i] = buffer[i]; | ||
| 131 | } | ||
| 132 | |||
| 133 | return SendData(local_buffer); | ||
| 134 | } | ||
| 135 | |||
| 123 | DriverResult JoyconCommonProtocol::SendVibrationReport(std::span<const u8> buffer) { | 136 | DriverResult JoyconCommonProtocol::SendVibrationReport(std::span<const u8> buffer) { |
| 124 | std::vector<u8> local_buffer(MaxResponseSize); | 137 | std::vector<u8> local_buffer(MaxResponseSize); |
| 125 | 138 | ||