EasyManua.ls Logo

Fujitsu F2MC-16L - Page 59

Fujitsu F2MC-16L
68 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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
*

Other manuals for Fujitsu F2MC-16L

Related product manuals