Merge pull request #14149 from unknownbrackets/usb-wait

Usb: Implement state waits
This commit is contained in:
Henrik Rydgård 2021-02-16 00:02:08 +01:00 committed by GitHub
commit a2669377eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 131 additions and 33 deletions

View file

@ -50,11 +50,10 @@
#include "Core/HLE/KernelWaitHelpers.h"
#include "Core/HLE/ThreadQueueList.h"
typedef struct
{
struct WaitTypeNames {
WaitType type;
const char *name;
} WaitTypeNames;
};
const WaitTypeNames waitTypeNames[] = {
{ WAITTYPE_NONE, "None" },
@ -83,18 +82,13 @@ const WaitTypeNames waitTypeNames[] = {
{ WAITTYPE_ASYNCIO, "AsyncIO" },
{ WAITTYPE_MICINPUT, "Microphone input"},
{ WAITTYPE_NET, "Network"},
{ WAITTYPE_USB, "USB" },
};
const char *getWaitTypeName(WaitType type)
{
int waitTypeNamesAmount = sizeof(waitTypeNames)/sizeof(WaitTypeNames);
for (int i = 0; i < waitTypeNamesAmount; i++)
{
if (waitTypeNames[i].type == type)
{
return waitTypeNames[i].name;
}
const char *getWaitTypeName(WaitType type) {
for (WaitTypeNames info : waitTypeNames) {
if (info.type == type)
return info.name;
}
return "Unknown";