nfcInit(): wait for NFC sysmodule to initialize

This commit is contained in:
fincs 2017-06-29 18:42:08 +02:00
parent be79735c31
commit 0475b59e12

View File

@ -37,7 +37,13 @@ Result nfcInit(NFC_OpType type)
if (R_SUCCEEDED(ret)) if (R_SUCCEEDED(ret))
{ {
nfc_optype = type; nfc_optype = type;
ret = NFC_Initialize(type); for (;;)
{
ret = NFC_Initialize(type);
if (ret != 0xd0a17480)
break;
svcSleepThread(500000);
}
if (R_FAILED(ret)) svcCloseHandle(nfcHandle); if (R_FAILED(ret)) svcCloseHandle(nfcHandle);
} }
if (R_FAILED(ret)) AtomicDecrement(&nfcRefCount); if (R_FAILED(ret)) AtomicDecrement(&nfcRefCount);