Renesas M3T-MR100 Network Card User Manual


 
- 207 -
6.2 Development Procedure Example
This chapter outlines the development procedures on the basis of a typical MR100 application example.
6.2.1 Applications Program Coding
Figure 6.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 han-
dler.
Main Task
Image expansion task
Printer engine task
Centronics interface interrupt handler
This program uses the following MR100 library functions.
sta_tsk()
Starts a task. Give the appropriate ID number as the argument to select the task to be activated. When the ker-
nel_id.h file, which is generated by the configurator, is included, it is possible to specify the task by name (char-
acter string).
39
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 completion of
one-page data input.
39
The configurator converts the ID number to the associated name(character string) in accordance with the information entered int the con-
figuration file.