Texas Instruments TMS320 User Manual page 144

Dsp/bios v5.40
Hide thumbs Also See for TMS320:
Table of Contents

Advertisement

Tasks
4.4.1.1 Creating and Deleting Tasks Dynamically
4.4.1.2 Creating Tasks Statically
4-40
You can spawn DSP/BIOS tasks by calling the function TSK_create, whose
parameters include the address of a C function in which the new task begins
its execution. The value returned by TSK_create is a handle of type
TSK_Handle, which you can then pass as an argument to other TSK
functions.
TSK_Handle TSK_create(fxn, attrs, [arg,] ...)
Fxn
fxn;
TSK_Attrs
*attrs
Arg
arg
A task becomes active when it is created and preempts the currently running
task if it has a higher priority.
The memory used by TSK objects and stacks can be reclaimed by calling
TSK_delete. TSK_delete removes the task from all internal queues and frees
the task object and stack by calling MEM_free.
Any semaphores, mailboxes, or other resources held by the task are not
released. Deleting a task that holds such resources is often an application
design error, although not necessarily so. In most cases, such resources
should be released prior to deleting the task.
Void TSK_delete(task)
TSK_Handle
task;
Note:
Catastrophic failure can occur if you delete a task that owns resources that
are needed by other tasks in the system. See TSK_delete, in the TMS320
DSP/BIOS API Reference Guide for your platform for details.
You can also create tasks statically using Tconf. The configuration allows you
to set a number of properties for each task and for the TSK Manager itself.
For a complete description of all TSK properties, see TSK Module in the
TMS320 DSP/BIOS API Reference Guide for your platform.
While it is running, a task that was created statically behaves exactly the
same as a task created with TSK_create. You cannot use the TSK_delete
function to delete statically-created tasks. See Section 2.4, Creating
DSP/BIOS Objects Dynamically, page 2-16, for a discussion of the benefits
of creating objects statically.

Advertisement

Table of Contents
loading

Table of Contents