⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 utl.h

📁 使用於 TI dsk6711中的很多好用的例子可以看
💻 H
字号:
/*

 *  Copyright 2003 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.

 *

 *  @(#) XDAS 2.51.00 11-29-2003 (xdas-2.50.00.9)

 */

/*

 *  ======== 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()

{

#ifdef _54_

    asm(" .word 0xf4f0");       /* break into C54x CCS */

#endif

}



/*

 *  ======== 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 + -