mirror of
https://github.com/wiiu-env/ftpiiu_plugin.git
synced 2024-11-26 06:34:17 +01:00
Wait for wifi on start
This commit is contained in:
parent
74c7e00f14
commit
2ff33ca398
29
source/ftp.c
29
source/ftp.c
@ -1065,7 +1065,34 @@ ftp_init(void)
|
||||
int rc;
|
||||
|
||||
#ifdef _3DS
|
||||
Result ret;
|
||||
Result ret = 0;
|
||||
u32 wifi = 0;
|
||||
bool loop;
|
||||
|
||||
console_print(GREEN "Waiting for wifi...\n" RESET);
|
||||
|
||||
/* wait for wifi to be available */
|
||||
while((loop = aptMainLoop()) && !wifi && (ret == 0 || ret == 0xE0A09D2E))
|
||||
{
|
||||
hidScanInput();
|
||||
if(hidKeysDown() & KEY_B)
|
||||
{
|
||||
loop = false;
|
||||
break;
|
||||
}
|
||||
|
||||
ret = ACU_GetWifiStatus(&wifi);
|
||||
if(ret != 0)
|
||||
wifi = 0;
|
||||
}
|
||||
|
||||
if(ret != 0)
|
||||
console_print(RED "ACU_GetWifiStatus returns 0x%lx\n" RESET, ret);
|
||||
|
||||
if(!loop || ret != 0)
|
||||
return -1;
|
||||
|
||||
console_print(GREEN "Ready!\n" RESET);
|
||||
|
||||
#if ENABLE_LOGGING
|
||||
/* open log file */
|
||||
|
@ -63,6 +63,7 @@ main(int argc,
|
||||
{
|
||||
#ifdef _3DS
|
||||
/* initialize needed 3DS services */
|
||||
acInit();
|
||||
gfxInitDefault();
|
||||
gfxSet3D(false);
|
||||
sdmcWriteSafe(false);
|
||||
@ -88,6 +89,7 @@ main(int argc,
|
||||
#ifdef _3DS
|
||||
/* deinitialize 3DS services */
|
||||
gfxExit();
|
||||
acExit();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user