Jump to content

Wilsom

Members
  • Posts

    2
  • Joined

  • Last visited

Wilsom's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Here is my test code .... I dont think its in the code but anyway...all coding examples are hanging at wifi-checkinit(); ------------------------cut----------------------- #include <nds.h> #include <dswifi9.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #include <stdio.h> #define VCOUNT (*((u16 volatile *) 0x04000006)) void initGraphics(){ videoSetMode(0); videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE); vramSetBankC(VRAM_C_SUB_BG); SUB_BG0_CR = BG_MAP_BASE(31); BG_PALETTE_SUB[255] = RGB15(31,31,31); consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31),(u16*)CHAR_BASE_BLOCK_SUB(0), 16); } void Timer_50ms(void) { Wifi_Timer(50); } void arm9_synctoarm7() { REG_IPC_FIFO_TX = 0x87654321; } void arm9_fifo() { u32 value = REG_IPC_FIFO_RX; if ( value == 0x87654321 ) Wifi_Sync(); } int main(void) { initGraphics(); iprintf("Start Main\n"); { REG_IPC_FIFO_CR = IPC_FIFO_ENABLE | IPC_FIFO_SEND_CLEAR; u32 Wifi_pass= Wifi_Init(WIFIINIT_OPTION_USELED); REG_IPC_FIFO_TX = 0x12345678; REG_IPC_FIFO_TX = Wifi_pass; *((volatile u16 *)0x0400010E) = 0; irqInit(); irqSet(IRQ_TIMER3, Timer_50ms); irqEnable(IRQ_TIMER3); irqSet(IRQ_FIFO_NOT_EMPTY, arm9_fifo); irqEnable(IRQ_FIFO_NOT_EMPTY); REG_IPC_FIFO_CR = IPC_FIFO_ENABLE | IPC_FIFO_RECV_IRQ; Wifi_SetSyncHandler(arm9_synctoarm7); // Timer3 ???? *((volatile u16 *)0x0400010C) = -6553; // 6553.1 * 256 cycles = ~50ms; *((volatile u16 *)0x0400010E) = 0x00C2; // enable, irq, 1/256 clock iprintf("Wifi Check init start \n"); while ( Wifi_CheckInit() == 0 ) { while(VCOUNT>192); while(VCOUNT<192); } } iprintf("WiFi Initiated\n"); { int i; Wifi_AutoConnect(); while(1) { i = Wifi_AssocStatus(); if ( i == ASSOCSTATUS_ASSOCIATED ) { iprintf("Associated\n"); break; } if ( i == ASSOCSTATUS_CANNOTCONNECT ) { iprintf("Can Not Connect\n"); break; } } } while(1) { swiWaitForVBlank(); } return 0; }
  2. Hi There, Yes I have exactly the same issue been over the code many times and from the exmaples seems to be the same issue. All the Best Mike
×
×
  • Create New...