📄 inttimer2410.c
字号:
#include"2410addr.h"
void INT_Timer_Initialize(void)
{
rTCFG0=0x00000064; //prescaler0 100
rTCFG1=0x00000011; //divide value 1/4
rTCNTB0=0x5dc;
rTCNTB1=0x1000;
rTCON=0x00000a0a; //auto load, invert off, manual update, stop timer
rSRCPND=0x0;
rINTPND=0x0;
/*INTIALIZE THE INTERRUPT*/
rINTMOD=0x0; //all irq
rINTMSK=0xffffffff; //disable all interrupt source
rINTSUBMSK=0xffff; //disable all sub interrupt source
}
/* open the interrupt timer0 and eint0 */
void ENABLE_INTERRUPT(void)
{
rINTMSK=~(BIT_TIMER0|BIT_EINT0);
rTCON=0x00000009;
}
void ENABLE_INTERRUPT_1(void)
{
rINTMSK&=~(BIT_TIMER1);
rTCON=0x00000909;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -