Texas Instruments TMS320 User Manual page 38

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

Advertisement

Creating and Building a CCSv4 Project for DSP/BIOS Applications
2.1.2
How hello.c Uses DSP/BIOS
2-8
The hello.c program uses DSP/BIOS's LOG module to send a message to
the host.
The first few lines include the header files for DSP/BIOS modules used in this
file. In DSP/BIOS programs, always include the std.h file first, then include the
module header files. This example uses the LOG module, so that header file
is also included.
#include <std.h>
#include <log.h>
The program must also include the header file that will be generated from the
.tcf configuration file. This file has the filename <tcf_file>cfg.h. For example,
if the .tcf file for a project is hello.tcf, the #include statement would be as
follows:
#include "hellocfg.h"
The main() function simply prints a message to a log using the LOG_printf
API. This API is very efficient. To reduce execution time, LOG_printf just
passes raw data to the host PC; formatting is done on the PC.
/*
======== main ======== */
Void main()
{
LOG_printf(&trace, "hello world!");
After the main() function is complete, it returns. In more complicated
applications, the return statement has the effect of turning control over to
DSP/BIOS scheduling to run hardware interrupts (HWI), software interrupts
(SWI), tasks (TSK), and idle functions (IDL) as needed.
/* fall into DSP/BIOS idle loop */
return;

Advertisement

Table of Contents
loading

Table of Contents