#139125 - melw - Sun Sep 02, 2007 10:45 am
Does anyone have an idea why deinitilializing and then reinitializing the DS wifi won't work all the way? Even if the initialization seems to go through on a second time, no socket connections can be created afterwards.
A working solution:
Last edited by melw on Mon Sep 03, 2007 9:25 am; edited 2 times in total
A working solution:
Code: |
// ARM9 side, assuming ARM7 is straight from wifi_lib_test template void preinit_wifi() // call only once when firing up the wifi { u32 Wifi_pass = Wifi_Init(WIFIINIT_OPTION_USELED); REG_IPC_FIFO_TX = 0x12345678; REG_IPC_FIFO_TX = Wifi_pass; *((volatile u16 *)0x0400010E) = 0; // disable timer3 irqSet(IRQ_TIMER3, Timer_50ms); // setup timer IRQ irqEnable(IRQ_TIMER3); Wifi_SetSyncHandler(arm9_synctoarm7); // tell wifi lib to use our handler to notify arm7 *((volatile u16 *)0x0400010C) = (u16)-6553; // 6553.1 * 256 cycles = ~50ms; *((volatile u16 *)0x0400010E) = 0x00C2; // enable, irq, 1/256 clock while(Wifi_CheckInit()==0) swiWaitForVBlank(); } void init_wifi() // can be called each time { Wifi_EnableWifi(); Wifi_AutoConnect(); } void uninit_wifi() { Wifi_DisconnectAP(); Wifi_DisableWifi(); } |
Last edited by melw on Mon Sep 03, 2007 9:25 am; edited 2 times in total