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

📄 clktest.c

📁 dsp f2812 运行环境ccs2000的源程序
💻 C
字号:
/*
 *  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.
 *  
 */
/* "@(#) DSP/BIOS 4.90.280 06-24-03 (barracuda-m11)" */
/*
 *  ======== clktest.c =======
 *  In this example, a task goes to sleep # number of ticks and 
 *  prints the time after it wakes up.
 *
 */

#include <std.h>

#include <log.h>
#include <clk.h>
#include <tsk.h>

#include "clktestcfg.h"

/*
 *  ======== main ========
 */
Void main()
{
    LOG_printf(&trace, "clktest example started.\n");
}

Void taskFxn(Arg value_arg)
{
    Int value = ArgToInt (value_arg); 
    Uns ticks;
#ifdef _28_ 
    LOG_printf(&trace, "The time in task is: %d ticks", (Arg)TSK_time());
#else 
    LOG_printf(&trace, "The time in task is: %d ticks", (Int)TSK_time());
#endif

    ticks = (value * CLK_countspms()) / CLK_getprd();

#ifdef _28_
    LOG_printf(&trace, "task going to sleep for %d ticks... ", (Arg)ticks);
#else
    LOG_printf(&trace, "task going to sleep for %d ticks... ", ticks);
#endif

    TSK_sleep(ticks);

#ifdef _28_
    LOG_printf(&trace, "...awake! Time is: %d ticks", (Arg)TSK_time());
#else
    LOG_printf(&trace, "...awake! Time is: %d ticks", (Int)TSK_time());
#endif
}
    

⌨️ 快捷键说明

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