The super-loop example-program
The present chapter’s example-program is a timed super-loop. (We’ll refer to it here as simply the example-program.) The timed super-loop was described in the prior chapter, in pseudo-code format, and it is shown below. The example-program implements that pseudo-code. This section explains how the example-program works, and how to run it on the dev-board. How to create the program will be described later in the chapter.
// Start the super-loop's repeating timer
start_timer();
while(1)
{
func1();
func2();
func3();
// Sleep until the timer's period expires
disable_interrupts();
while( !timer_expired_flag )
{
sleep();
enable_interrupts();
disable_interrupts();
}
enable_interrupts();
}
The super-loop example-program is described in the following sections:
- Technical requirements
- How the example-program works
- Design and testing considerations...