EasyManuals Logo

Texas Instruments TMS320 User Manual

Texas Instruments TMS320
288 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #47 background imageLoading...
Page #47 background image
Creating DSP/BIOS Objects Dynamically
Program Generation 2-17
Most XXX_create functions accept as their last parameter a pointer to a
structure of type XXX_Attrs which is used to assign attributes to the newly-
created object. By convention, the object is assigned a set of default values
if this parameter is NULL. These default values are contained in the constant
structure XXX_ATTRS listed in the header files, enabling you to first initialize
a variable of type XXX_Attrs and then selectively update its fields with
application-dependent attribute values before calling XXX_create. Sample
code that creates a dynamic object using the TSK_create is shown in
Example 2-1.
Example 2-1. Creating and Referencing Dynamic Objects
The XXX_create function passes back a handle that is an address to the
task’s object. This handle is can then be passed as an argument when
referencing, for example, deleting the object, as shown in Example 2-2.
Objects created with XXX_create are deleted by calling the function
XXX_delete. This frees the object’s internal memory back to the system for
later use.
Use the global constant XXX_ATTRS to copy the default values, update its
fields, and pass as the argument to the XXX_create function.
Example 2-2. Deleting a Dynamic Object
Dynamically-created DSP/BIOS objects allow for a program to adapt at
runtime.
#include <tsk.h>
TSK_Attrs attrs;
TSK_Handle task;
attrs = TSK_ATTRS;
attrs.name = "reader";
attrs.priority = TSK_MINPRI;
task = TSK_create((Fxn)foo, &attrs);
TSK_delete (task);

Table of Contents

Other manuals for Texas Instruments TMS320

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320 and is the answer not in the manual?

Texas Instruments TMS320 Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320
CategoryComputer Hardware
LanguageEnglish

Related product manuals