MCPcopy Create free account
hub / github.com/Cpasjuste/pplay / usbThread

Function usbThread

src/usbfs.cpp:10–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8static u32 g_usbDeviceCount;
9
10int 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
39void usbInit() {
40

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected