- 211 -
7.
Detailed Applications
7.1 Program Coding Procedure in C Language
7.1.1
Task Description Procedure
1. Describe the task as a function.
To register the task for the MR100, enter its function name in the configuration file. When, for instance, the
function name "task()" is to be registered as the task ID number 3, proceed as follows.
task[3]{
name
=
ID_task;
entry_address = task();
stack_size
= 100;
priority
= 3;
};
2. At the beginning of file, be sure to include "itron.h",”kernel.h” which is in system directory
as well as "kernel_id.h" which is in the current directory. That is, be sure to enter the fol-
lowing two lines at the beginning of file.
#include <itron.h>
#include
<kernel.h>
#include "kernel_id.h"
3. No return value is provided for the task start function. Therefore, declare the task start
function as a void function.
4. A function that is declared to be static cannot be registered as a task.
5. It isn't necessary to describe ext_tsk() at the exit of task start function.
If you exit the task
from the subroutine in task start function, please describe ext_tsk() in the subroutine.
6. It is also possible to describe the task startup function, using the infinite loop.
#include
<itron.h>
#include
<kernel.h>
#include "kernel_id.h"
void task(void)
{
/* process */
}
Figure 7.1 Example Infinite Loop Task Described in C Language
40
The task is ended by ext_tsk() automatically if #pramga TASK is declared in the MR100. Similarly, it is ended by ext_tsk when returned
halfway of the function by return sentence.
Содержание 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...