| 8 | static u32 g_usbDeviceCount; |
| 9 | |
| 10 | int usbThread(void *arg) { |
| 11 | |
| 12 | (void) arg; |
| 13 | Result rc = 0; |
| 14 | int idx = 0; |
| 15 | |
| 16 | Waiter status_change_event_waiter = waiterForUEvent(g_statusChangeEvent); |
| 17 | Waiter exit_event_waiter = waiterForUEvent(&g_exitEvent); |
| 18 | |
| 19 | printf("usbThread\n"); |
| 20 | |
| 21 | while (true) { |
| 22 | rc = waitMulti(&idx, -1, status_change_event_waiter, exit_event_waiter); |
| 23 | if (R_FAILED(rc)) continue; |
| 24 | if (g_usbDevices) { |
| 25 | free(g_usbDevices); |
| 26 | g_usbDevices = nullptr; |
| 27 | } |
| 28 | |
| 29 | if (idx == 1) break; |
| 30 | |
| 31 | g_usbDeviceCount = usbHsFsGetMountedDeviceCount(); |
| 32 | g_usbDevices = (UsbHsFsDevice *) calloc(g_usbDeviceCount, sizeof(UsbHsFsDevice)); |
| 33 | } |
| 34 | |
| 35 | printf("usbThread: end\n"); |
| 36 | return 0; |
| 37 | } |
| 38 | |
| 39 | void usbInit() { |
| 40 |
nothing calls this directly
no outgoing calls
no test coverage detected