定时器中断调试不出来,郁闷啊~

2019-03-24 14:47发布

#include<msp430x44x.h>
volatile int tick=0;//被不同线程访问
void main(void)
{WDTCTL=WDTPW+WDTHOLD;//关看门狗
IE2=BTIE;//使能基本定时器中断
BTCTL=BTSSEL+BT_fCLK2_DIV256;//设置控制寄存器
_EINT();//使能中断指令ENIT后面的指令总会被执行,中断请求悬而未决的时间也能执行
  while(1)
  {
    if(tick==327)
    {
      tick=0;
    }
  }
}
#pragma vector=BASICTIMER_VECTOR
_interrupt void BasicTimerInt(void)//基本定时器中断
{
    tick+=1;
} 调试信息 main.c 
Error[Pe077]: this declaration has no storage class or type specifier E:MSPTEST449simulator_BasicTimerIntmain.c 17
Warning[Pe609]: this kind of pragma may not be used here E:MSPTEST449simulator_BasicTimerIntmain.c 16
Error[Pe065]: expected a ";" E:MSPTEST449simulator_BasicTimerIntmain.c 17
Warning[Pe012]: parsing restarts here after previous syntax error E:MSPTEST449simulator_BasicTimerIntmain.c 20
Error while running C/C++ compiler
 
Done. 2 error(s), 2 warning(s)
此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
3条回答
鸵鸟蝈蝈
1楼-- · 2019-03-24 19:51
_interrupt下划线加两个。。。
lllhhheee
2楼-- · 2019-03-25 00:34
< :TI_MSP430_内容页_SA7 --> 2楼说的有道理。。。
peter_zheng
3楼-- · 2019-03-25 03:08
 精彩回答 2  元偷偷看……

一周热门 更多>

相关问题

    相关文章