Understanding DSPLink error codes

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

Contents

Overview

DSPLink returns different error codes for different kinds of failures. Several times, just the error code value returned from the function is sufficient to understand the cause of the failure, and it can be directly corrected.

GPP-side codes

The return values are of two types:

DSP-side status codes

Using DSPLink macros for checking error/success status

DSPLink provides macros DSP_SUCCEEDED and DSP_FAILED, which can be used to check whether a DSPLink API call has passed or failed.
These macros should be used for checking return status of all APIs instead of directly checking against status codes. Using these macros ensures that any change in/addition in/removal of return codes shall not impact applications developed using the DSPLink APIs.

Usage

The macros should be used in the following way:

status = MSGQ_open (...) ;
if (DSP_SUCCEEDED (status)) {
    ...
}

Constraints

This macros should not be used as:

if (DSP_SUCCEEDED (MSGQ_open (...))) {
    ...
}

Since DSP_SUCCEEDED is a macro, using it in the above manner can cause the function to be invoked multiple times.

Leave a Comment
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox