diff options
| author | 2023-01-27 13:12:54 -0600 | |
|---|---|---|
| committer | 2023-01-27 17:12:04 -0600 | |
| commit | 8647c727781accf79fe78c19eeee9acdb24f2927 (patch) | |
| tree | b72ad4638850786d36b7568be6cd1a933c518dd1 /src/input_common/helpers/joycon_protocol/common_protocol.cpp | |
| parent | Merge pull request #9685 from liamwhite/minmax (diff) | |
| download | yuzu-8647c727781accf79fe78c19eeee9acdb24f2927.tar.gz yuzu-8647c727781accf79fe78c19eeee9acdb24f2927.tar.xz yuzu-8647c727781accf79fe78c19eeee9acdb24f2927.zip | |
input_common: joycon: Remove magic numbers from calibration protocol
Diffstat (limited to 'src/input_common/helpers/joycon_protocol/common_protocol.cpp')
| -rw-r--r-- | src/input_common/helpers/joycon_protocol/common_protocol.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/input_common/helpers/joycon_protocol/common_protocol.cpp b/src/input_common/helpers/joycon_protocol/common_protocol.cpp index 417d0dcc5..2f0ab6b2a 100644 --- a/src/input_common/helpers/joycon_protocol/common_protocol.cpp +++ b/src/input_common/helpers/joycon_protocol/common_protocol.cpp | |||
| @@ -23,7 +23,7 @@ void JoyconCommonProtocol::SetNonBlocking() { | |||
| 23 | 23 | ||
| 24 | DriverResult JoyconCommonProtocol::GetDeviceType(ControllerType& controller_type) { | 24 | DriverResult JoyconCommonProtocol::GetDeviceType(ControllerType& controller_type) { |
| 25 | std::vector<u8> buffer; | 25 | std::vector<u8> buffer; |
| 26 | const auto result = ReadSPI(CalAddr::DEVICE_TYPE, 1, buffer); | 26 | const auto result = ReadSPI(SpiAddress::DEVICE_TYPE, 1, buffer); |
| 27 | controller_type = ControllerType::None; | 27 | controller_type = ControllerType::None; |
| 28 | 28 | ||
| 29 | if (result == DriverResult::Success) { | 29 | if (result == DriverResult::Success) { |
| @@ -148,7 +148,7 @@ DriverResult JoyconCommonProtocol::SendVibrationReport(std::span<const u8> buffe | |||
| 148 | return SendData(local_buffer); | 148 | return SendData(local_buffer); |
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | DriverResult JoyconCommonProtocol::ReadSPI(CalAddr addr, u8 size, std::vector<u8>& output) { | 151 | DriverResult JoyconCommonProtocol::ReadSPI(SpiAddress addr, u8 size, std::vector<u8>& output) { |
| 152 | constexpr std::size_t MaxTries = 10; | 152 | constexpr std::size_t MaxTries = 10; |
| 153 | std::size_t tries = 0; | 153 | std::size_t tries = 0; |
| 154 | std::array<u8, 5> buffer = {0x00, 0x00, 0x00, 0x00, size}; | 154 | std::array<u8, 5> buffer = {0x00, 0x00, 0x00, 0x00, size}; |