Hi
In this loop i load receiving scan resolute list from wifi module, and load only the ssid name and rssi to message array.
The loop do the job perfect, but in the beginning i did mistake with "if CHECK=>AX1 THEN GOTO break33 'END OF LIST"
So the MCU become "MAD" ,turn-on the buzzer , and few output i have on my pcb and even send "nul" at uart Tx and stay at loop forever.
It made me wonder, why the WDT didn't reset.
Here is the loop.
RE var byte[998]
Message var byte[998]
;AX1 is total receiving bytes.
;CHECK is the start point
Code:'****************************** SearchSymbol: 'search "," Symbol '*** Must set T4 before send to this loop T1=0 FOR A3 = CHECK TO AX1' IF RE[A3]=Symb THEN T1=T1+1 IF T1=T4 THEN break9 NEXT A3 break9: CHECK=A3 return '********************************************* '*** load all +SCAN SSID,RSSI list to Message array *** '********************************************* GET_SSID_list: MessageL=0 T4=2 'multiple of the symbol x time "space" GET_SSID_list1: Symb=" " '"Space" GOSUB SearchSymbol 'Search THE SYMBOLE if CHECK=>AX1 THEN GOTO break33 'END OF LIST CHECK=CHECK+1 'to jump on the "space" if RE[CHECK]="," THEN 'If hidden wifi move to next line T4=1 'multiple of the symbol goto GET_SSID_list1 endif FOR A3 = CHECK TO AX1 'Get SSID name if RE[A3]="," then break31 Message[MessageL]=RE[A3] MessageL=MessageL+1 next A3 break31: T4=2 'multiple of symbol, JUMP on channel Symb="," gosub SearchSymbol CHECK=A3+1 'jump on "," Message[MessageL]="," 'insert "," Between ssid to rssi (ssid,rssi) MessageL=MessageL+1 FOR A3 = CHECK TO AX1 'Get RSSI if RE[A3]=$D then break32 'CR Message[MessageL]=RE[A3] MessageL=MessageL+1 NEXT A3 break32: CHECK=A3 if CHECK=>AX1 THEN GOTO break33 'END OF LIST Message[MessageL]=$A 'insert LF MessageL=MessageL+1 T4=1 'multiple of the symbol GOTO GET_SSID_list1 'Next line break33: RETURN![]()




Bookmarks