mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-26 19:11:00 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2603e77f37 | |||
| 2f53c0ef6b |
@@ -1,4 +1,4 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||||
@@ -83,20 +83,21 @@ void Joycons::ScanThread(std::stop_token stop_token) {
|
|||||||
constexpr u16 nintendo_vendor_id = 0x057e;
|
constexpr u16 nintendo_vendor_id = 0x057e;
|
||||||
Common::SetCurrentThreadName("JoyconScanThread");
|
Common::SetCurrentThreadName("JoyconScanThread");
|
||||||
|
|
||||||
|
auto last_ret = 0u;
|
||||||
do {
|
do {
|
||||||
SDL_hid_device_info* devs = SDL_hid_enumerate(nintendo_vendor_id, 0x0);
|
auto ret = SDL_hid_device_change_count();
|
||||||
SDL_hid_device_info* cur_dev = devs;
|
if (last_ret == 0u || last_ret != ret) {
|
||||||
|
last_ret = ret;
|
||||||
while (cur_dev) {
|
SDL_hid_device_info* devs = SDL_hid_enumerate(nintendo_vendor_id, 0x0);
|
||||||
if (IsDeviceNew(cur_dev)) {
|
for (auto* cur_dev = devs; cur_dev; cur_dev = cur_dev->next) {
|
||||||
LOG_DEBUG(Input, "Device Found,type : {:04X} {:04X}", cur_dev->vendor_id,
|
if (IsDeviceNew(cur_dev)) {
|
||||||
cur_dev->product_id);
|
LOG_DEBUG(Input, "Device Found,type : {:04X} {:04X}", cur_dev->vendor_id, cur_dev->product_id);
|
||||||
RegisterNewDevice(cur_dev);
|
RegisterNewDevice(cur_dev);
|
||||||
|
}
|
||||||
|
cur_dev = cur_dev->next;
|
||||||
}
|
}
|
||||||
cur_dev = cur_dev->next;
|
SDL_hid_free_enumeration(devs);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_hid_free_enumeration(devs);
|
|
||||||
} while (Common::StoppableTimedWait(stop_token, std::chrono::seconds{5}));
|
} while (Common::StoppableTimedWait(stop_token, std::chrono::seconds{5}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user