
B–61863E–1/06
5. TUTORIAL
GENERAL
21
This section explains about the PMCMDI task that is a task for the display
screen.
The application program in chapter 5.3 can only be executed once after
pressing the [RUN] key. Application in chapter 5.4.1 is modified and can
be executed each time when the PMCMDI screen appears.
The files are in the directory \tutorial\5–4–1.
(1) File confirmation.
Please use the files (ctl.c and tutorial.bld) in the directories as listed
below.
The files in \tutorial\5–4–1\rc for PMC–SC/SC3/SC4.
The files in \tutorial\5–4–1\nb for PMC–NB/NB2.
D ctl.c Link control statement
D task1.c Source code
D task1.con Command file for binder
D tutorial.bld Build file
D tutorial.con Command file for binder
(2) Modification.
The difference from chapter 5.3 is described below.
D task1.c
The function task1() does not return after the end of the display,
because the functions are programmed in an endless loop.
The function pl_pcmdi_wait() is issued before the display and
waits until the display changes to the PMCMDI screen.
The function pl_pcmdi_wait() is in waiting condition while the
PMCMDI screen is not displayed. The application task1 can not
continue while pl_pcmdi_wait() is in this condition.
If the display switches to PMCMDI screen, task1 can continue
and the text “HELLO WORLD” is displayed.
If the function pl_pcmdi_wait() is issued on PMCMDI screen,
task1 does not become waiting condition.
File \5–3\task1.c
void far task1(void)
{
pl_pcmdi();
printf(”HELLO, WORLD!\n”);
}
← switch to PMCMDI screen
File \5–4\task1.c
void far task1(void)
{
while (1) {
pl_pcmdi_wait();
printf(”HELLO, WORLD!\n”);
}
}
← waits for switch to PMCMDI
screen
5.4
PMCMDI TASK
5.4.1
Execution by Switch to
PCMDI Screen