
CHAPTER 4 TASK MANAGEMENT
User’s Manual U14833EJ2V0UM
41
4.14 Task Exceptions
4.14.1 Task exception processing routines
A task exception processing routine is a routine that is activated when an event exceptional to a task occurs.
Because tasks can be divided into task main processing and task exception processing routines, the task exception
processing routine is actually a part of a task and therefore operates on the same context as the task main processing
routine.
In other words, when a task exception processing routine is activated, the applied parameters, such as the stack to
be used, the priority order, the status of interrupts (enabled/disabled), and the use of the coprocessor, are identical to
those of the task, or task main processing routine with which the exception processing routine is paired.
Note that task exception processing routines are described as void type functions with FLGPTN and VP_INT type
arguments. The bit pattern of the exception source that triggers activation of the task exception processing routine
(described later) and the extended data held by the tasks are passed for these arguments.
Example)
void task_exception(FLGPTN texptn, VP_INT exinf)
{
...
return;
}
4.14.2 Defining task exception processing routines
A task exception processing routine is defined by issuing def_tex. Equivalent processing to def_tex can also be
realized by specifying the static API DEF_TEX when the system is activated up.
def_tex specifies a task ID number (or the ID number of the task (task main processing routine) with which it is
paired) as its parameter. Note that if def_tex is issued for a task for which a task exception processing routine has
already been defined, the previous definition is deleted, and the new exception processing routine definition becomes
valid.
4.14.3 Canceling task exception processing routine definitions
A task exception processing routine definition is canceled by issuing def_tex with NULL specified in the definition
packet address of the exception processing routine.