Better question is why you would use GOSUB without RETURN? That just doesn't have any sense.
If stack is full then PBP can't call internal subroutines, and it crash...
You just disabled reset on overflow. That fuse doesn't expand stack to infinity and beyond.
Better solution to get same result
Code:MainLoop: GOSUB SearchForClockSignal goto MainLoop SearchForClockSignal: FOR J = 0 TO 7 USBSERVICE SERIN2 PORTE.3, 32, 3, CLOCKSEARCHFAILED, [wait(252), STR RFID_IN\6] USBSERVICE IF RFID_IN[0] = 252 THEN RETURN 'GOTO MAINLOOP SquaresArray[0] = 255 SquaresArray[1] = 202 SquaresArray[2] = RFID_IN[0] SquaresArray[3] = RFID_IN[1] SquaresArray[4] = RFID_IN[2] SquaresArray[5] = RFID_IN[3] SquaresArray[6] = RFID_IN[4] SquaresArray[7] = RFID_IN[5] if PPB_DeviceState = 32 then 'ONLY WHEN THERE IS A USB CONNECTION PRESENT GOSUB SendUSBData endif RETURN 'CLOCK SERIAL COMMUNICATION WAS RECEIVED CLOCKSEARCHFAILED: NEXT J RETURN




Bookmarks