I recently had a project I was working on that would work fine for a while, then reboot and work fine for a while, then completely lock up. After a power cycle this would repeat. The project had buttons, and I was polling the buttons in a subroutine, if a button press was detected I jumped somewhere else using a goto. I soon realized there was a pattern and it was a certain number of button presses, I forget exactly how many. I moved my button polling routine to the main loop instead of a subroutine and it fixed the problem. I assume a stack was overflowing causing the problems because of using a goto inside of a subroutine.
Bookmarks