summaryrefslogtreecommitdiffstats
path: root/src/input_common/gcadapter
diff options
context:
space:
mode:
authorAmeer <aj662@drexel.edu>2020-06-26 01:31:51 +0200
committerAmeer <aj662@drexel.edu>2020-06-26 01:31:51 +0200
commit3f739514e3fa5f3e5c64fa8172c796bd686f6e7d (patch)
tree2f17eff571c07555cf23e5fb6b68449873ed1666 /src/input_common/gcadapter
parentpadbutton enum class and struct initiailization (diff)
downloadyuzu-3f739514e3fa5f3e5c64fa8172c796bd686f6e7d.tar
yuzu-3f739514e3fa5f3e5c64fa8172c796bd686f6e7d.tar.gz
yuzu-3f739514e3fa5f3e5c64fa8172c796bd686f6e7d.tar.bz2
yuzu-3f739514e3fa5f3e5c64fa8172c796bd686f6e7d.tar.lz
yuzu-3f739514e3fa5f3e5c64fa8172c796bd686f6e7d.tar.xz
yuzu-3f739514e3fa5f3e5c64fa8172c796bd686f6e7d.tar.zst
yuzu-3f739514e3fa5f3e5c64fa8172c796bd686f6e7d.zip
Diffstat (limited to 'src/input_common/gcadapter')
-rw-r--r--src/input_common/gcadapter/gc_adapter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/input_common/gcadapter/gc_adapter.cpp b/src/input_common/gcadapter/gc_adapter.cpp
index bba9bcc69..173b5c325 100644
--- a/src/input_common/gcadapter/gc_adapter.cpp
+++ b/src/input_common/gcadapter/gc_adapter.cpp
@@ -95,7 +95,7 @@ void Adapter::Read() {
while (adapter_thread_running) {
libusb_interrupt_transfer(usb_adapter_handle, input_endpoint, adapter_payload.data(),
- sizeof(adapter_payload), &payload_size_in, 32);
+ sizeof(adapter_payload), &payload_size_in, 16);
payload_size_copy = 0;
{
std::lock_guard<std::mutex> lk(s_mutex);
@@ -106,9 +106,9 @@ void Adapter::Read() {
if (payload_size_copy != sizeof(adapter_payload_copy) ||
adapter_payload_copy[0] != LIBUSB_DT_HID) {
- // TODO: It might be worthwhile to Shutdown GC Adapter if we encounter errors here
LOG_ERROR(Input, "error reading payload (size: %d, type: %02x)", payload_size_copy,
adapter_payload_copy[0]);
+ adapter_thread_running = false; // error reading from adapter, stop reading.
} else {
for (int port = 0; port < pads.size(); port++) {
pads[port] = GetPadStatus(port, adapter_payload_copy);
@@ -291,14 +291,14 @@ void Adapter::Reset() {
if (adapter_thread_running) {
adapter_thread_running = false;
- adapter_input_thread.join();
}
+ adapter_input_thread.join();
adapter_controllers_status.fill(ControllerTypes::None);
current_status = NO_ADAPTER_DETECTED;
if (usb_adapter_handle) {
- libusb_release_interface(usb_adapter_handle, 0);
+ libusb_release_interface(usb_adapter_handle, 1);
libusb_close(usb_adapter_handle);
usb_adapter_handle = nullptr;
}