summaryrefslogtreecommitdiff
path: root/src/input_common/helpers/joycon_driver.cpp
diff options
context:
space:
mode:
authorGravatar german772023-01-13 23:29:05 -0600
committerGravatar Narr the Reg2023-01-20 00:51:45 -0600
commit340f15d1fa79594dbe12a6e19140ba012751b533 (patch)
tree7a9ef54a17f927e4b8cf98dd32dd6d41c0d75201 /src/input_common/helpers/joycon_driver.cpp
parentcore: hid: Only set the polling mode to the correct side (diff)
downloadyuzu-340f15d1fa79594dbe12a6e19140ba012751b533.tar.gz
yuzu-340f15d1fa79594dbe12a6e19140ba012751b533.tar.xz
yuzu-340f15d1fa79594dbe12a6e19140ba012751b533.zip
input_common: Address byte review
Diffstat (limited to 'src/input_common/helpers/joycon_driver.cpp')
-rw-r--r--src/input_common/helpers/joycon_driver.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/input_common/helpers/joycon_driver.cpp b/src/input_common/helpers/joycon_driver.cpp
index 552572343..4159e5717 100644
--- a/src/input_common/helpers/joycon_driver.cpp
+++ b/src/input_common/helpers/joycon_driver.cpp
@@ -123,7 +123,7 @@ DriverResult JoyconDriver::InitializeDevice() {
123} 123}
124 124
125void JoyconDriver::InputThread(std::stop_token stop_token) { 125void JoyconDriver::InputThread(std::stop_token stop_token) {
126 LOG_INFO(Input, "JC Adapter input thread started"); 126 LOG_INFO(Input, "Joycon Adapter input thread started");
127 Common::SetCurrentThreadName("JoyconInput"); 127 Common::SetCurrentThreadName("JoyconInput");
128 input_thread_running = true; 128 input_thread_running = true;
129 129
@@ -157,7 +157,7 @@ void JoyconDriver::InputThread(std::stop_token stop_token) {
157 157
158 is_connected = false; 158 is_connected = false;
159 input_thread_running = false; 159 input_thread_running = false;
160 LOG_INFO(Input, "JC Adapter input thread stopped"); 160 LOG_INFO(Input, "Joycon Adapter input thread stopped");
161} 161}
162 162
163void JoyconDriver::OnNewData(std::span<u8> buffer) { 163void JoyconDriver::OnNewData(std::span<u8> buffer) {
@@ -349,7 +349,7 @@ JoyconDriver::SupportedFeatures JoyconDriver::GetSupportedFeatures() {
349} 349}
350 350
351bool JoyconDriver::IsInputThreadValid() const { 351bool JoyconDriver::IsInputThreadValid() const {
352 if (!is_connected) { 352 if (!is_connected.load()) {
353 return false; 353 return false;
354 } 354 }
355 if (hidapi_handle->handle == nullptr) { 355 if (hidapi_handle->handle == nullptr) {
@@ -491,7 +491,7 @@ DriverResult JoyconDriver::SetRingConMode() {
491 491
492bool JoyconDriver::IsConnected() const { 492bool JoyconDriver::IsConnected() const {
493 std::scoped_lock lock{mutex}; 493 std::scoped_lock lock{mutex};
494 return is_connected; 494 return is_connected.load();
495} 495}
496 496
497bool JoyconDriver::IsVibrationEnabled() const { 497bool JoyconDriver::IsVibrationEnabled() const {