打印

请教各位大虾~~

[复制链接]
1450|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
kokoromi|  楼主 | 2009-3-11 11:23 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
msp430f449的一个程序,总出错,错误在中断服务程序那里,错误提示在最下面,不知道是怎么回事,还有就是430的16个中断函数用C语言怎么写?

#include "msp430x44x.h"

void main()
{
  WDTCTL=WDTPW+WDTHOLD;
  FLL_CTL1|=SMCLKOFF+SELM_XT2;
  TACTL|=TASSEL_1+TACLR+TAIE+MC_1;
  P1DIR|=0x01;
  TACTL|=MC_2;
  _EINT();
  
  for(;;)
  {
    _BIS_SR(LPM3_bits);
    _NOP();
  }
  
}

/*下面这些出错:*/

#pragma vector=TIMERA_VECTOR //该行为22行
_interrupt void Timer_A()
{
  switch(TAIV)
  {
  case 2:break;
  case 4:break;
  case 10:P1OUT^=0x01;break;
  }
}

错误说明:

Error[Pe077]: this declaration has no storage class or type specifier  23 
Warning[Pe609]: this kind of pragma may not be used here 22 
Error[Pe065]: expected a ";"  23 
Warning[Pe001]: last line of file ends without a newline  31 
Warning[Pe012]: parsing restarts here after previous syntax error  31 



相关帖子

沙发
ayb_ice| | 2009-3-11 20:43 | 只看该作者

找个例程看一下就知道了

使用特权

评论回复
板凳
ayb_ice| | 2009-3-11 21:53 | 只看该作者

_interrupt写错了,应该是__interrupt

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

111

主题

344

帖子

3

粉丝