定时器产生一个1ms的中断

[复制链接]
1002|11
 楼主| renyaq 发表于 2019-9-22 15:11 | 显示全部楼层 |阅读模式
定时器产生一个1ms的中断
liuzaiy 发表于 2019-9-22 15:16 | 显示全部楼层
用UDB模式吧
pangb 发表于 2019-9-22 15:19 | 显示全部楼层
对,并且在中断程序中添加函数isr_1_GetState();
 楼主| renyaq 发表于 2019-9-22 15:24 | 显示全部楼层
那样的话中断只在上电时响应一次。从中断中退出后,系统不再进入中断。
zyf部长 发表于 2019-9-22 15:27 | 显示全部楼层
isr_1_GetState();函数,干啥的
 楼主| renyaq 发表于 2019-9-22 15:32 | 显示全部楼层
说是此函数能自动清楚中断标志
xxmmi 发表于 2019-9-22 15:35 | 显示全部楼层
Function Name: isr_1_GetState
********************************************************************************
* Summary:
*   Gets the state (enabled, disabled) of the Interrupt.
*
*
* Parameters:
*   void.
*
*
* Return:
*   1 if enabled, 0 if disabled.
*
*
*******************************************************************************/
uint8 isr_1_GetState(void)
{
    /* Get the state of the general interrupt. */
    return (*isr_1_INTC_SET_EN & isr_1__INTC_MASK) ? 1:0;
}
chuxh 发表于 2019-9-22 15:39 | 显示全部楼层
看函数的代码就怎么简单,仅仅只有一个返回值,莫非其内部还有其他的机制能让程序在访问此变量的时候能自动清零?
liliang9554 发表于 2019-9-22 15:52 | 显示全部楼层
你应该用Timer_GetInterruptSource (void)或Timer_ReadStatusRegister (void)
dingy 发表于 2019-9-22 15:56 | 显示全部楼层
而不是isr_1_GetState(); 来清除现在的中断以允许下次timer 中断的到来
pengf 发表于 2019-9-22 16:01 | 显示全部楼层
一般这种问题,肯定是没有清中断
 楼主| renyaq 发表于 2019-9-22 16:06 | 显示全部楼层
嗯,我再好好缕一缕吧,有了好消息及时通知大家,结贴喽
您需要登录后才可以回帖 登录 | 注册

本版积分规则

700

主题

10138

帖子

4

粉丝
快速回复 在线客服 返回列表 返回顶部
0