Renesas 70 Manual De Usuario

Descargar
Página de 162
Chapter 4 Applications Development Procedure Overview   
   
- 62 - 
4.2  Development Procedure Example 
This chapter outlines the development procedures on the basis of a typical MR308 application example. 
4.2.1 
Applications Program Coding 
Figure 4.2 shows a program that simulates laser beam printer operations. Let us assume that the file describing 
the laser beam printer simulation program is named lbp.c. This program consists of the following three tasks and 
one interrupt handler. 
• 
Main Task 
• 
Image expansion task 
• 
Printer engine task 
• 
Centronics interface interrupt handler 
 
This program uses the following MR308 library functions. 
• 
sta_tsk() 
Starts a task. Give the appropriate ID number as the argument to select the task to be activated. When 
the kernel_id.h file, which is generated by the configurator, is included, it is possible to specify the task 
by name (character string).
• 
wai_flg() 
Waits until the eventflag is set up. In the example, this function is used to wait until one page of data is 
entered into the buffer via the Centronics interface. 
• 
wup_tsk() 
Wakes up a specified task from the WAITING state. This function is used to start the printer engine 
task. 
• 
slp_tsk() 
Causes a task in the RUNNING state to enter the WAITING state. In the example, this function is used 
to make the printer engine task wait for image expansion. 
• 
iset_flg() 
Sets the eventflag. In the example, this function is used to notify the image expansion task of the com-
pletion of one-page data input. 
 
 
 
                                                      
42
  The configurator converts the ID number to the associated name(character string) in accordance with the information entered int the con-
figuration file.