Chapter 5 Detailed Applications
- 69 -
7. To specify a task, use the string written in the task definition item “name” of the configura-
tion file.
45
wup_tsk(ID_main);
8. To specify an event flag, semaphore, or mailbox, use the respective strings defined in the
configuration file.
For example, if an event flag is defined in the configuration file as shown below,
flag[1]{
name = ID_abc;
};
To designate this eventflag, proceed as follows.
set_flg(ID_abc,&setptn);
9. To specify a cyclic or alarm handler, use the string written in the cyclic or alarm handler
definition item “name” of the configuration file.
sta_cyc(ID_cyc);
10. When a task is reactivated by the sta_tsk() service call after it has been terminated by the
ter_tsk() service call, the task itself starts from its initial state.
46
However, the external
variable and static variable are not automatically initialized when the task is started. The
external and static variables are initialized only by the startup program (crt0mr.a30), which
actuates before MR308 startup.
11. The task executed when the MR308 system starts up is setup.
12. The variable storage classification is described below.
The MR308 treats the C language variables as indicated in Table 5.1.
Table 5.1 C Language Variable Treatment
Variable storage class Treatment
Global Variable Variable shared by all tasks
Non-function static variable Variable shared by the tasks in the same file
Auto Variable
Register Variable
Static variable in function
Variable for specific task
45
The configurator generates the file “kernel_id.h” that is used to convert the ID number of a task into the string to be specified. This means
that the #define declaration necessary to convert the string specified in the task definition item “name” into the ID number of the task is
made in “kernel_id.h.” The same applies to the cyclic and alarm handlers.
46
The task starts from its start function with the initial priority in a wakeup counter cleared state.