MainBrain Firmware Reference
Main Program Loop
The main program loop continuously outputs the heartbeat, checks for messages, directives, and screen touches and loads the initial graphics screen. External functions can request a new graphics screen and the main Function will change the current screen global so that another function can load the newly requested graphics. A message or directive is requested by an external program and subsequently processed by the main loop. This is done by branching to a function that handles the message box requested by the message or, for a directive, initiates an I/O cycle. Touch events are handled by the touch interrupt service which determines how many touches occured and the X,Y location on the screen and passes the information to global variables that can be processed by other external functions. The heartbeat toggles TP1 each time the main loop starts a new cycle. This indicates the main loop is indeed looping and at what frequency. This can be a valuable debugging tool.