Skip to content

Commit 33148c5

Browse files
committed
Fix NFC init to wait for the NFC module to finish loading.
1 parent 7d74c0a commit 33148c5

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

source/main.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,14 @@ void menu() {
243243
void start() {
244244
if (!loadKeys())
245245
return;
246-
Result ret = nfcInit(NFC_OpType_RawNFC);
246+
Result ret;
247+
while (1) {
248+
ret = nfcInit(NFC_OpType_RawNFC);
249+
if (!R_FAILED(ret))
250+
break;
251+
if (R_LEVEL(ret) != RL_TEMPORARY)
252+
break;
253+
}
247254
if(R_FAILED(ret)) {
248255
printf("nfcInit() failed: 0x%08x.\n", (unsigned int)ret);
249256
return;

0 commit comments

Comments
 (0)