- 212 -
#include
<itron.h>
#include
<kernel.h>
#include "kernel_id.h"
void task(void)
{
for(;;){
/*
process
*/
}
}
Figure 7.2 Example Task Terminating with ext_tsk() Described in C Language
7. To specify a task, use the string written in the task definition item “name” of the configura-
tion file.
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.
riable and static variable are not automatically initialized when the task is started. The ex-
ternal and static variables are initialized only by the startup program (crt0mr.a30), which
actuates before MR100 startup.
11. The task executed when the MR100 system starts up is setup.
12. The variable storage classification is described below.
The MR100 treats the C language variables as indicated in Table 7.1 C Language Variable Treatment.
Table 7.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
7.1.2
Writing a Kernel (OS Dependent) Interrupt Handler
When describing the kernel interrupt handler in C language, observe the following precautions.
41
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.
42
The task starts from its start function with the initial priority in a wakeup counter cleared state.
Содержание Emulator System M3T-MR100
Страница 3: ...M3T MR100 4 V 1 00 User s Manual User s Manual Rev 1 00 2007 09 Real time OS for R32C 100 Series...
Страница 6: ......
Страница 14: ......
Страница 16: ...xii...
Страница 18: ......
Страница 78: ......
Страница 242: ......
Страница 269: ...253 235 entry_address alm2 236 name ID_alm2 237 exinf 0x12345678 238 239 240 241 242 End of Configuration 243...
Страница 279: ...263...
Страница 290: ......
Страница 294: ......
Страница 304: ...288...
Страница 306: ...1753 Shimonumabe Nakahara ku Kawasaki shi Kanagawa 211 8668 Japan M3T MR100 4 V 1 00 REJ10J1523 0100 User s Manual...