summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/GCAdapter.cpp
AgeCommit message (Collapse)Author
2023-08-17Use structs for config callback IDsJosJuice
This way you can't mix up regular config callback IDs and CPU thread config callback IDs. (It would be rather bad if you did!)
2023-08-12GCAdapter: Fix Android unused constant warningDentomologist
CONTROLLER_OUTPUT_INIT_PAYLOAD_SIZE is only used by the libusb implementation.
2023-08-12GCAdapter: Fix spelling of constantsDentomologist
2023-07-05Switch libusb_config_descriptor to RAII typenyanpasu64
2023-07-05Workaround GC adapter detection breaking when reset failsnyanpasu64
2023-07-05Reset GC adapter upon IO error after sleep-wakenyanpasu64
Fixes GC adapter breaking on sleep-wake on Linux and burning a full CPU core. This is cleaner than alternative approaches.
2023-07-05Don't burn a CPU core and spam logs when GC Adapter failsnyanpasu64
2023-07-05Fix memory leak in libusb codenyanpasu64
2023-02-09Resolve various "no previous declaration" warningsPokechu22
2022-11-27CoreTiming: Refactor to class.Admiral H. Curtiss
2022-10-22GCAdapter: Process pad state in read thread and other general cleanups.Jordan Woyak
2022-06-08GCAdapter: Compare with LIBUSB_SUCCESS instead of 0Pokechu22
2022-06-08Log warnings when LibusbUtils::GetDeviceList failsPokechu22
2022-06-02GCAdapter: Use LibusbUtils::ErrorWrap in log messagesPokechu22
2022-06-02GCAdapter: Make local variables const where possiblePokechu22
2022-06-02GCAdapter: Merge Read logicPokechu22
2022-06-02GCAdapter: Have the read thread control the write threadPokechu22
This was done for Android in 6cc40b12357ae339abcb44517810af304bab77ea.
2022-06-02GCAdapter: Exit early if the adapter fails to open on AndroidPokechu22
This is only so that indentation is consistent with the non-android code.
2022-06-02GCAdapter: Remove check on write size on androidPokechu22
It was removed for non-android in 56239d1ae139998a7cde17ff02f0526ffb17f5ef, and android already uses a separate thread, so presumably this isn't needed anymore.
2022-06-02GCAdapter: Harmonize read/write thread variable namesPokechu22
2022-06-02GCAdapter: Remove unused includesPokechu22
2022-06-02GCAdapter: Use determinism hack on AndroidPokechu22
This hack was added in 8f0cbefbe57762de92284ef151e984f52ec8d7e6, and the part of it in SI_DeviceGCAdapter is present on Android already, so I don't see any reason why this part doesn't apply to Android.
2022-06-02GCAdapter: Convert ControllerType to an enum classPokechu22
2022-06-02GCAdapter: Fix rumble enabled config on AndroidPokechu22
I believe the setting already existed in the UI; it just wasn't implemented in GCAdapter_Android.cpp.
2022-06-02GCAdapter: Use std::array for controller read and write payloadsPokechu22
2022-06-02GCAdapter: Merge GCAdapter.cpp and GCAdapter_Android.cppPokechu22
This is mostly a brainless merge, #ifdef-ing anything that doesn't match between the two while preserving common logic. I didn't rename any variables (although similar ones do exist), but I did change one log that was ERROR on android and NOTICE elsewhere to just always be NOTICE. Further merging will follow.
2022-04-23Merge pull request #10540 from nyanpasu64/fix-gcadapter-atomicsJosJuice
Remove atomic usage and fix mutex locking in GCAdapter code
2022-04-22GCAdapter: don't call libusb_detach_kernel_driver on appleShawn Hoffman
2022-04-22GCAdapter: fix retval check of libusb_detach_kernel_driverShawn Hoffman
2022-04-22GCAdapter: move libusb context teardown lastShawn Hoffman
2022-04-22GCAdapter: some macro cleanupShawn Hoffman
2022-04-22GCAdapter: set read/write thread namesShawn Hoffman
2022-03-27Remove unnecessary atomic usage in GCAdapter.cppnyanpasu64
You can safely read or write non-atomic integers on multiple threads, as long as every thread reading or writing it holds the same mutex while doing so (here, s_mutex). Removing the atomic accesses makes the code faster, but the actual performance difference is probably negligible.
2022-03-10GCAdapter: Defer initialization until MainWindow::InitControllersPokechu22
If libusb fails to initialize, an assertion fails, but if that happens before the main window is created, then Dolphin just dies. Now, the panic alert is properly shown and the user can ignore it.
2022-01-08Config: Port SI device settings to new config system.Admiral H. Curtiss
2022-01-05Config: Port GC Adapter settings to new config system.Admiral H. Curtiss
2021-07-05treewide: convert GPLv2+ license info to SPDX tagsPierre Bourdon
SPDX standardizes how source code conveys its copyright and licensing information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX tags are adopted in many large projects, including things like the Linux kernel.
2021-06-07Lint: End of namespaceSepalani
2021-05-05InputCommon: replace SerialInterface log with ControllerInterfaceFiloppi
where appropriate. SerialInterface was a leftover from the past, and makes no sense to be used on actual/real controllers.
2020-10-23InputCommon: Migrate logging over to fmtLioncash
Continues the migration of the logging calls over to the fmt capable ones.
2020-07-18Use range loop (if possible)Filip Gawin
2020-07-09InputCommon/GCAdapter: Unbreak Mayflash GCAdapters by allowing ↵Jordan Woyak
libusb_control_transfer call to fail.
2020-07-07InputCommon/GCAdapter: Fix offbrand "GCAdapters" with a ↵Jordan Woyak
libusb_control_transfer call.
2020-05-10GCAdapter: add libusb error logging on reads/writesPierre Bourdon
2019-06-26Use separate libusb contexts to avoid thread safety issuesLéo Lam
Unfortunately, it appears that using libusb's synchronous transfer API from several threads causes nasty race conditions in event handling and can lead to deadlocks, despite the fact that libusb's synchronous API is documented to be perfectly fine to use from several threads (only the manual polling functionality is supposed to require special precautions). Since usbdk was the only real reason for using a single libusb context and since usbdk (currently) has so many issues with Dolphin, I think dropping support for it in order to fix other backends is acceptable.
2019-06-07Core/ConfigManager: Use forward declarations where applicableLioncash
Avoids dragging in IniFile, EXI device and SI device headers in this header which is quite widely used throughout the codebase. This also uncovered a few cases where indirect inclusions were being relied upon, which this also fixes.
2019-05-29GCAdapter: Handle dynamic status updates for non-hotplug libusbVincent Duvert
Detect when the setup function found no adapter, or found one but could not connect to it, and report the new status in that case.
2019-05-29GCPadWiiUConfigDialog: Update the adapter state dynamicallyVincent Duvert
Update the GC adapter config GUI if the adapter is plugged or unplugged.
2019-05-29GCAdapter: Report libusb open errors to the userVincent Duvert
If opening the adapter fails, report the libusb error message in the GUI instead of “No Adapter Detected”. The error condition is removed when the adapter is unplugged.
2019-05-29GCAdapter: Close libusb handle if an open error occursVincent Duvert
The handle was previously kept open, which was causing future adapter plug/unplug events to be ignored.