38
APPENDIX
.
■ Operations of Sample Programs
Figure Bb shows the sample program listings.
The behaviors of samples 1 and 2 are slightly different. This is because, while the serial driver in
sample 1 is implemented based on interruption, the one in sample 2 is implemented based on
polling. The remainder of this appendix applies mainly to sample 1 whose operation is more
difficult to understand than sample 2.
Figure Bb Sample Programs
[Install directory]
rtos
bin
lib
907
smpsys
knl
rcf
smpdrv
syslib
smp1
smp1.wsp
Storage directory for
Sample1 work space file
smp2.wsp
Sample2 work space file
Sample system1
Storage directory for
smp2
Sample system2
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