260
9.
Sample Program Description
9.1 Overview of Sample Program
As an example application of MR100, the following shows a program that outputs a string to the standard output device
from one task and another alternately.
Table 9.1 Functions in the Sample Program
Function
Name
Type ID
No.
Priority
Description
main()
Task
1
1
Starts task1 and task2.
task1()
Task
2
2
Outputs "task1 running."
task2()
Task
3
3
Outputs "task2 running."
cyh1() Handler
1
Wakes
up
task1().
The content of processing is described below.
•
The main task starts task1, task2, and cyh1, and then terminates itself.
•
task1 operates in order of the following.
1.
Gets a semaphore.
2.
Goes to a wakeup wait state.
3.
Outputs "task1 running."
4.
Frees the semaphore.
•
task2 operates in order of the following.
1.
Gets a semaphore.
2.
Outputs "task2 running."
3.
Frees the semaphore.
cyh1 starts every 100 ms to wake up task1.
Содержание 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...