📄 utl.h
字号:
/*
* Copyright 2001 by Texas Instruments Incorporated.
* All rights reserved. Property of Texas Instruments Incorporated.
* Restricted rights to use, duplicate or disclose this code are
* granted through contract.
* U.S. Patent Nos. 5,283,900 5,392,448
*/
/* "@(#) XDAS 2.12 05-21-01 (__imports)" */
/*
* ======== utl.h ========
*/
#ifndef UTL_
#define UTL_
#include <log.h>
/*
* ======== UTL_Load ========
*/
typedef struct UTL_Load {
Int load;
Int prev;
} UTL_Load;
/*
* ======== UTL_str ========
* String'ify the argument x
*/
#define UTL_str(x) _UTL_str(x)
#define _UTL_str(x) #x
/*
* ======== UTL_break ========
* This function will cause the program to halt *if* CCS is connected
* to the target. This is useful when a program exits or detects an
* anomolus condition (e.g., assertion violation).
*
* Warning: not all DSPs are supported. If a DSP is not supported
* this function is a nop.
*/
static inline Void UTL_break()
{
}
/*
* ======== UTL_assert ========
* Assert macro for exceptions
*/
#define UTL_assert(expr) { \
((expr) ? ((void)0) : \
(UTL_break(), /* break into CCS */ \
UTL_error("Assertion Violation: " __FILE__ ", line " \
UTL_str(__LINE__) " (" UTL_str(expr) ")", 0))); \
}
/*
* ======== UTL_error ========
* Place an error message (and up to 1 argument) into the BIOS system log
*/
extern Void UTL_error(String msg, Arg arg);
/*
* ======== UTL_loop ========
* This function simulates a load on the DSP by executing 1000 * loopCount
* instructions, where loopCount is the input parameter to UTL_loop().
*/
extern Void UTL_loop(Int loopCount);
/*
* ======== UTL_load ========
* This function simulates a load and writes a message to the "stdout" log
* whenever the load changes. The client pointer is used to pass the
* address of any global symbol (the symbol name is displayed by CCS).
*/
extern Void UTL_load(Void *client, UTL_Load *lp);
#endif /* UTL_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -