47
APPENDIX B Running the Sample System
Figure Bk Execution Breakpoints
(2) Run the sample system to the point immediately before set_flg of b_tsk (hereafter
expressed as the point immediately before bp2). Run the sample system by clicking on the
bp2 point shown in Figure Bk). HyperTerminal will then display “ hello, i am b_task. ”
(3) Run the sample system to the point immediately before bp1 again. HyperTerminal will then
display “ HE Lh Le01,1 oI, AiM aAm_ TbA_StKa.s ”.
(4) Run the sample system to the point immediately before bp2 again. HyperTerminal will then
display “k. ”.
(5) Repeat steps (3) and (4) above for output operation.
The data output by each task is set as follows:
a_tsk:
“ HELLO, I AM A_TASK. ”
b_tsk:
“ hello, i am b_task. ”
In step (5), the tasks look as if they are performing output operation alternately as shown in
Figure Bl.
cwai_flg(FLG_1);
/* a_tsk */
printf(“%s”, b_msg);
/* b_tsk */
set_flg(FLG_1);
/* a_tsk */
printf(“%s”, b_msg); /* b_tsk */
cwai_flg(FLG_1);
/* a_tsk */
Figure Bl Task Operation
Task a_tsk(void)
{
While(1) {
cwai_flg(FLG_1) ;
printf(“%s,a_msg) ;
}
}
Higher priority
Lower priority
Flag waiting
Flag set
Event flag ID = 1
Task b_tsk(void)
{
While(1) {
printf(“%s”,b_msg) ;
set_flg(FLG_1) ;
}
}
Initial pattern
value 0
bp1
bp2
*
Содержание F2MC-16L Series
Страница 2: ... ...
Страница 4: ... ...
Страница 10: ...vi ...
Страница 12: ...viii ...
Страница 44: ...32 CHAPTER 4 Program Reference for the Standard I O Library ...
Страница 53: ...41 APPENDIX B Running the Sample System Figure Be Project Member List ...
Страница 54: ...42 APPENDIX Figure Bf Set Configuration File Dialog Box ...
Страница 64: ...52 APPENDIX Figure Cb Sample System Memory Map Continued ...
Страница 65: ...53 INDEX INDEX The index follows on the next page This is listed in alphabetic order ...
Страница 68: ... ...