- 70 -
[
[
[
[
F
F
u
u
n
n
c
c
t
t
i
i
o
o
n
n
a
a
l
l
d
d
e
e
s
s
c
c
r
r
i
i
p
p
t
t
i
i
o
o
n
n
]
]
]
]
This service call starts the task indicated by tskid. In other words, it places the specified task from DORMANT state into
READY state or RUNNING state. This service call does not enqueue task activation requests. Therefore, if a task activa-
tion request is issued while the target task is not DORMANT state, the error code E_OBJ is returned to the service call is-
suing task. This service call is effective only when the specified task is in DORMANT state. The task start code stacd is 32
bits long. This task start code is passed as parameter to the activated task.
If a task is restarted that was once terminated by ter_tsk or ext_tsk, the task performs the following as it starts up.
1. Initializes the current priority of the task.
2. Clears the number of queued wakeup requests.
3. Clears the number of nested forcible wait requests.
If this service call is to be issued from task context, use sta_tsk; if issued from non-task context, use ista_tsk.
[
[
[
[
E
E
x
x
a
a
m
m
p
p
l
l
e
e
p
p
r
r
o
o
g
g
r
r
a
a
m
m
s
s
t
t
a
a
t
t
e
e
m
m
e
e
n
n
t
t
]
]
]
]
<<Example statement in C language>>
#include <itron.h>
#include <kernel.h>
#include “kernel_id.h”
void task()
{
ER
ercd;
VP_INT stacd = 0;
ercd = sta_tsk( ID_task2, stacd );
:
}
void task2(VP_INT msg)
{
if(msg == 0)
:
}
<<Example statement in assembly language>>
.INCLUDE mr100.inc
.GLB
task
task:
:
PUSHM
R3R1
PUSH.W
R2
sta_tsk #ID_TASK4,#100
: