mirror of
https://github.com/wiiu-env/ftpiiu_plugin.git
synced 2024-11-26 14:44:16 +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;
|
int rc;
|
||||||
|
|
||||||
#ifdef _3DS
|
#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
|
#if ENABLE_LOGGING
|
||||||
/* open log file */
|
/* open log file */
|
||||||
|
@ -63,6 +63,7 @@ main(int argc,
|
|||||||
{
|
{
|
||||||
#ifdef _3DS
|
#ifdef _3DS
|
||||||
/* initialize needed 3DS services */
|
/* initialize needed 3DS services */
|
||||||
|
acInit();
|
||||||
gfxInitDefault();
|
gfxInitDefault();
|
||||||
gfxSet3D(false);
|
gfxSet3D(false);
|
||||||
sdmcWriteSafe(false);
|
sdmcWriteSafe(false);
|
||||||
@ -88,6 +89,7 @@ main(int argc,
|
|||||||
#ifdef _3DS
|
#ifdef _3DS
|
||||||
/* deinitialize 3DS services */
|
/* deinitialize 3DS services */
|
||||||
gfxExit();
|
gfxExit();
|
||||||
|
acExit();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user