utl.c

来自「DSP 基于 TMS320C6711 DSK 的功能演示程序」· C语言 代码 · 共 57 行

C
57
字号
/*
 *  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.c ========
 */
#include <std.h>
#include <utl.h>
#include <log.h>

static LOG_Obj *stdoutLog = NULL;

/*
 *  ======== UTL_bind ========
 */
Void UTL_bind(LOG_Obj *outLog)
{
    stdoutLog = outLog;
}

/*
 *  ======== UTL_error ========
 */
Void UTL_error(String msg, Arg arg)
{
    /* put message into system log and disable log (to preserve error) */
    LOG_error(msg, arg);
    LOG_disable(LOG_D_system);

    /* loop forever so CPU state is preserved */
    for (;;) {
        UTL_break();
    }
}

/*
 *  ======== UTL_load ========
 */
Void UTL_load(Void *client, UTL_Load *lp)
{
    /* display confirmation of load change */
    if (lp->prev != lp->load && stdoutLog != NULL) {
        lp->prev = lp->load;
        LOG_printf(stdoutLog,
            "%r: new load = %d000 instructions per cycle", client, lp->load);
    }
    
    if (lp->load) {
        UTL_loop(lp->load);
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?