core timer.c

来自「ADI 公司的DSP ADSP21262 EZ-KIT LITE开发板的全部源代」· C语言 代码 · 共 33 行

C
33
字号
///////////////////////////////////////////////////////////////////////////////////////
//NAME:     Core Timer.c
//DATE:     9/18/03
//PURPOSE:  Core timer example for the ADSP-21262 Ez-kit
//
//USAGE:    Sets up the Core Timer using the C-Runtime Environment
//          Counts and displays the number of core interrupts serviced.
////////////////////////////////////////////////////////////////////////////////////////

#include <def21262.h>
#include <21262.h>
#include <stdio.h>
#include <signal.h>


int timer_count = 1;

//Timer interrupt service routine
void timer_isr (int sig)
{
    printf("Timer interrupt number %d\n",timer_count);
    timer_count++;
}

main()
{
    interrupts (SIG_TMZ, timer_isr);         /* enable low priority timer interrupt */
    timer_set(1000, 1000);              /* set tperiod and tcount of the timer */
    timer_on();                         /* start timer */
    while(1){};
}

⌨️ 快捷键说明

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