Bypassing usb count error

This commit is contained in:
Dmugetsu 2025-05-02 09:57:36 -06:00 committed by Dmugetsu
parent 98faff425e
commit 0763601d35

View File

@ -44,7 +44,18 @@ void PS4_SYSV_ABI sceUsbdExit() {
s64 PS4_SYSV_ABI sceUsbdGetDeviceList(SceUsbdDevice*** list) { s64 PS4_SYSV_ABI sceUsbdGetDeviceList(SceUsbdDevice*** list) {
LOG_DEBUG(Lib_Usbd, "called"); LOG_DEBUG(Lib_Usbd, "called");
return libusb_to_orbis_error(libusb_get_device_list(g_libusb_context, list)); static ssize_t last_count = -1;
ssize_t count = libusb_get_device_list(g_libusb_context, list);
if (count <= 0)
return libusb_to_orbis_error((int)count);
if (count != last_count) {
LOG_INFO(Lib_Usbd, "Found {} USB devices", count);
last_count = count;
}
return ORBIS_OK;
} }
void PS4_SYSV_ABI sceUsbdFreeDeviceList(SceUsbdDevice** list, s32 unref_devices) { void PS4_SYSV_ABI sceUsbdFreeDeviceList(SceUsbdDevice** list, s32 unref_devices) {