打印
[ZLG-ARM]

用EasyArm2131开发板 程序编译出错误

[复制链接]
1199|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
lnww|  楼主 | 2007-12-21 11:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我用EasyArm2131开发板做单键输入控制实验,按照《ARM微控制器基础与实战》书上P275页程序简单改写了一下,不知为什么编译总出现错误 
提示 Error   : (Serious) C2282E: expected ')' - inserted before ';'  main.c line 33    
Error   : (Serious) C2282E: expected ')' - inserted before ';'       main.c line 33 
Error   : (Serious) C2304E: <command> expected but found ')'        main.c line 33
Error   : (Serious) C2282E: expected ')' - inserted before ';'           main.c line 35   

Error   : (Serious) C2282E: expected ')' - inserted before ';'           main.c line 35   

Error   : (Serious) C2304E: <command> expected but found ')'       main.c line 35   

Error   : (Serious) C2282E: expected ')' - inserted before ';'          main.c line 38   

Error   : (Serious) C2282E: expected ')' - inserted before ';'       main.c line 38   

Error   : (Serious) C2304E: <command> expected but found ')'     main.c line 38   

E:\EasyARM2131\KEYIN-1\src\main.c: 0 warnings, 0 errors, 9 serious errors

#include "config.h"

#define  LEDCON  0x00040000;   /*P1.18引脚*/
#define  KEY     0x00010000;   //P0.16引脚

void WaitKey(void)
{  uint32 i;
   while(1)
   { while((IO0PIN&KEY)!=0);   //等待按键按下
     for(i=0;i<50000;i++);     //延时去抖
     if((IO0PIN&KEY)==0)break;
   }
   
   while((IO0PIN&KEY)==0);     //等待按键放开
}

int main (void)
{ PINSEL0=0x00000000;
  PINSEL1=0x00000000;
  PINSEL2=PINSEL2&(~0x08);
  
  IO0DIR=0x00000000;  //设置P0口为输入(包括P0.16)
  IO1DIR=LEDCON;      //设置P1.18为输出 控制LED闪烁
  while(1)
  { IO1SET=LEDCON;
    WaitKey();
    IO1CLR=LEDCON;
    WaitKey();
  } 
    return 0;
}

相关帖子

沙发
XDream| | 2007-12-21 12:35 | 只看该作者

re

看看这个帖子http://www.zlgmcu.com.cn/dispbbs.asp?boardID=29&ID=933&page=1

使用特权

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

本版积分规则

52

主题

104

帖子

1

粉丝