48
APPENDIX
However, HyperTerminal displays strings as shown in Figure Bm. From this output, the tasks do
not seem to be working as in Figure Bl.
Figure Bm Output at HyperTerminal
This is because the serial driver is implemented as described below. The serial driver in sample
program 1 invokes the interrupt handler on occurrence of a transmission enable interrupt and
uses the eventflag to notify the task of completion of preparation for output. That is, when the
printf function is execution, the cwai_flg system call is issued each time a character is output.
Figure Bn below illustrates this situation, focusing on a_tsk and b_tsk.
Figure Bn Sample Program Operation (2)
Even though a_tsk has a higher task priority than b_tsk, the tasks work as shown in Figure Bi
depending on how the drivers have been designed. This is because, although the ID3 eventflag
places the two tasks different in task priority in the wait state at the same time, the tasks are
scheduled by the FCFS (First Come First Service) system. If a_tsk enters the wait state after
b_tsk enters the wait state, b_tsk restarts working first when the conditions for releasing the
tasks from the wait state are satisfied. This symptom is called priority inversion.
a_tsk outputs a series of three characters “ HE ” in Figure Bn because the serial driver has a
single-character buffer.
hello,i am b_task. HE LhLe01,1 oI, AiM aAm_TbA_Stka.s k.
HE LhLe01,1 oI, AiM aAm_TbA_StKa.s k.HE LhLe01, 1 oI, AiM a
Am_TbA_TbA_StKa.s k.
a_tsk
b_tsk
f1
f3
• • • • • • •
f3 f1
: READY state
: RUN state
: WAIT state
f1: Issues cwa_flg(1).
f1: Issues set_flg(1).
f3
f3
f3
f3
f3
f3
f3
f3
f3
f3
f3
f3
a_tsk output “ ” “H” “E” “L” “L” “0” “,”
b_tsk output “hel...b_task.” ” ” “h” “e” “l” “l”
f3: Issues cwai_flg(3).
*
Содержание 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: ... ...