diff options
| author | 2023-01-27 22:30:44 -0600 | |
|---|---|---|
| committer | 2023-01-29 20:12:58 -0600 | |
| commit | c318a4c80b4b6eef9f8020f452573ef5c80f6716 (patch) | |
| tree | ea031039eb63ef385ceeb0a5c0694baa9e8da8be /src/input_common/helpers/joycon_protocol/ringcon.cpp | |
| parent | input_common: joycon: Fill missing enum data (diff) | |
| download | yuzu-c318a4c80b4b6eef9f8020f452573ef5c80f6716.tar.gz yuzu-c318a4c80b4b6eef9f8020f452573ef5c80f6716.tar.xz yuzu-c318a4c80b4b6eef9f8020f452573ef5c80f6716.zip | |
input_common: joycon: Remove Magic numbers from common protocol
Diffstat (limited to 'src/input_common/helpers/joycon_protocol/ringcon.cpp')
| -rw-r--r-- | src/input_common/helpers/joycon_protocol/ringcon.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/input_common/helpers/joycon_protocol/ringcon.cpp b/src/input_common/helpers/joycon_protocol/ringcon.cpp index 3c2ca4379..190cef812 100644 --- a/src/input_common/helpers/joycon_protocol/ringcon.cpp +++ b/src/input_common/helpers/joycon_protocol/ringcon.cpp | |||
| @@ -70,7 +70,7 @@ DriverResult RingConProtocol::StartRingconPolling() { | |||
| 70 | DriverResult RingConProtocol::IsRingConnected(bool& is_connected) { | 70 | DriverResult RingConProtocol::IsRingConnected(bool& is_connected) { |
| 71 | LOG_DEBUG(Input, "IsRingConnected"); | 71 | LOG_DEBUG(Input, "IsRingConnected"); |
| 72 | constexpr std::size_t max_tries = 28; | 72 | constexpr std::size_t max_tries = 28; |
| 73 | std::vector<u8> output; | 73 | SubCommandResponse output{}; |
| 74 | std::size_t tries = 0; | 74 | std::size_t tries = 0; |
| 75 | is_connected = false; | 75 | is_connected = false; |
| 76 | 76 | ||
| @@ -84,7 +84,7 @@ DriverResult RingConProtocol::IsRingConnected(bool& is_connected) { | |||
| 84 | if (tries++ >= max_tries) { | 84 | if (tries++ >= max_tries) { |
| 85 | return DriverResult::NoDeviceDetected; | 85 | return DriverResult::NoDeviceDetected; |
| 86 | } | 86 | } |
| 87 | } while (output[16] != static_cast<u8>(ExternalDeviceId::RingController)); | 87 | } while (output.external_device_id != ExternalDeviceId::RingController); |
| 88 | 88 | ||
| 89 | is_connected = true; | 89 | is_connected = true; |
| 90 | return DriverResult::Success; | 90 | return DriverResult::Success; |