查看: 1295|回复: 5
打印 上一主题 下一主题

iar编译430问题

[复制链接] qrcode

28

主题

31

帖子

95

积分

注册会员

Rank: 2

积分
95
楼主
跳转到指定楼层
发表于 2013-4-27 10:53 AM | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
一个简单的P1口中断例程,编译时出现如下错误,请问这是我哪里设置的不对还是少了那个头文件,还是其他什么问题,求大神指教 Error[Pe020]: identifier "SCG0" is undefined E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 46 Error[Pe020]: identifier "uint16_t" is undefined E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 50 Error[Pe020]: identifier "UCSCTL0" is undefined E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 51 Error[Pe020]: identifier "UCSCTL1" is undefined E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 52 Error[Pe020]: identifier "DCORSEL_4" is undefined E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 52 Error[Pe020]: identifier "UCSCTL2" is undefined E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 54 Error[Pe020]: identifier "MSP430_CPU_SPEED" is undefined E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 54 Error[Pe020]: identifier "UCSCTL4" is undefined E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 55 Warning[Pe223]: function "__bic_SR_register" declared implicitly E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 58 Error[Pe020]: identifier "P1IE" is undefined E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 132 Error[Pe020]: identifier "P2IE" is undefined E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 133 Error[Pe020]: identifier "MSP430_REQUIRE_LPM1" is undefined E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 151 Error[Pe020]: identifier "MSP430_REQUIRE_LPM1" is undefined E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 159 Warning[Pe223]: function "dint" declared implicitly E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 167 Warning[Pe223]: function "eint" declared implicitly E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 172 Warning[Pe223]: function "__get_SR_register" declared implicitly E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 221 Warning[Pe223]: function "__bic_SR_register" declared implicitly E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 222 Error[Pe020]: identifier "GIE" is undefined E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 222 Warning[Ta031]: When defining __low_level_init the header file \'intrinsics.h\' should  E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 231 have been included Error[Pe020]: identifier "WDTCTL" is undefined E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 234 Error[Pe020]: identifier "WDTPW" is undefined E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 234 Error[Pe020]: identifier "WDTHOLD" is undefined E:msp430中断新建文件夹contiki-2.6cpumsp430f5xxxmsp430.c 234 Error while running C/C++ compiler wismote_simple_main.c   Warning[Pa050]: non-native end of line sequence detected (this diagnostic is only  E:msp430中断新建文件夹contiki-2.6coresysautostart.h 1 issued once) Warning[Pe223]: function "button_init" declared implicitly E:msp430中断新建文件夹contiki-2.6platformwismotewismote_simple_main.c 71 Total number of errors: 16 Total number of warnings: 10
回复

使用道具 举报

0

主题

95

帖子

10

积分

新手上路

Rank: 1

积分
10
沙发
发表于 2013-4-27 04:50 PM | 只看该作者
头文件没选择好,或芯片型号有没有选对和头文件是不是匹配
回复 支持 反对

使用道具 举报

321

主题

418

帖子

993

积分

禁止访问

积分
993
板凳
发表于 2013-4-27 07:28 PM | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

0

主题

74

帖子

12

积分

新手上路

Rank: 1

积分
12
地板
发表于 2013-4-27 07:32 PM | 只看该作者
程序是在别的编译成功的程序上改的,头文件没敢动,还加了几个,不知道是不是还少哪个,所有程序如下
#include "contiki.h"
#include
#include "blink3.h"
#include "leds.h"
#include "uart1.h"
#include "stdio.h"
#include "dev/cc2520.h"
#include "lib/random.h"
#include "net/netstack.h"
#include "net/mac/frame802154.h"
#include "net/rime.h"

#include "node-id.h"
#include "sys/autostart.h"
#include "sys/profile.h"
//#include "sprintf.h"
#include "ds2411.h"
#include "i2c.h"
#include "light.h"
#include "dev/button-sensor.h"
#include "msp430x54x.h"
#include "isr_compat.h"

#include
#ifndef NODE_ID
#define NODE_ID        0x4
#endif /* NODE_ID */

void main(void)
{
/*
   * Initalize hardware.
   */
  WDTCTL = WDTPW + WDTHOLD;
  msp430_cpu_init();
  clock_init();
  I2C_Init();
  leds_init();
  ds2411_init();
  
  button_init();
  sensors_light_init();
  uart1_init(115200);

        //点亮LED灯
        P5OUT |= BIT2;
        P5DIR |= BIT2;
       
        P1DIR &= ~BIT4;        //中断引脚应该设置为输入
        P1IES |= BIT4;        //设置为下降沿触发 =0上升沿触发
        P1IFG &= ~BIT4;        //因为P1IES设置会使中断标志位置位,故清零
        P1IE |= BIT4;        //设置中断使能
        _EINT();        //打开总中断
        LPM3;                //设置为LPM3低功耗模式,产生中断时自动激活
                        //为活动模式,如果在中断中没有修改低功耗模
                        //式,中断程序执行完成后,又进入LPM3模式
        while(1);
}


#pragma vector = PORT1_VECTOR
__interrupt void P1_Interrupt(void)
{
        if((P1IFG&0x10) == BIT4)//判断是不是按键P10产生的中断
                                //因为P1端口共用这个中断向量表
        {
                P1IFG &= ~BIT4;        //中断标志清楚(注意)
                P5OUT ^= BIT2;        //LED取反
        }
        else
        {
                P1IFG &= ~BIT4;        //非P10的中断处理
        }
}
回复 支持 反对

使用道具 举报

3

主题

103

帖子

55

积分

注册会员

Rank: 2

积分
55
5#
发表于 2013-4-27 08:16 PM | 只看该作者
我重新把编译成功的例子改为我需要的程序,这次没有问题了,不知道什么原因,我原来也是这么做的啊,也许是之前不小心误删了什么东西吧。
回复 支持 反对

使用道具 举报

0

主题

78

帖子

10

积分

新手上路

Rank: 1

积分
10
6#
发表于 2014-3-1 08:36 PM | 只看该作者
顶起。。。。。。。。。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表