全新论坛MCU智学网上线,欢迎访问新论坛!稀缺资源、技术干货、参考设计、原厂资料尽在MCU智学网
更新自动建库工具PCB Footprint Expert 2023.13 Pro / Library Expert 破解版

求助 本人在keil编译出现以下错误 error l 118:reference made to erroneous exte

[复制链接]
6509 0

本文包含原理图、PCB、源代码、封装库、中英文PDF等资源

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
在keil中出现error l 118:reference made to erroneous external  无法生成目标
程序如下 :#include <reg51.h>
#include <intrins.h>
#define   uchar unsigned char
#define   uint  unsigned int  
sbit RS=P2^0;
sbit RW=P2^1;
sbit E=P2^2;
long Ncount=0,aq=(65536-10000)/256,bq=(65536-10000)%256;
uchar b,q,w,m;
void delay(int n)
{  int i,j;
  for (i=0;i<m;i++)
  for (j=0;j<100;j++);
}
void Busy()
{
uchar busy;
do
{
E=0;
RS=0;
RW=1;
delay(1);
P1=0xFF;
E=1;
busy=P1;
delay(1);
E=0;
}
while(busy&0x80);
     }
void write_com(uchar j)
{E=0;
RS=0;
RW=0;
E=1;
P1=j;
busy();
E=0;
}
void write_data(uchar j)
{ E=0;
  RS=1;
  RW=0;  
  E=1;
  P1=j;
  busy();
  E=0;
}
void init(void)
{
write_com(0x38);
write_com(0x0c);
write_com(0x06);
write_com(0x01);
}
void init1(void)
{
  TMOD=0x15;
  EA=0;
  TH1=aq;
  TL1=bq;
  TH0=0X00;
  TL0=0X00;
  TR0=1;
  TR1=1;
  TF0=0;
  TF1=0;
}
void bintobcd(void)
{
Ncount=TH0;
Ncount=(Ncount<<8)|TL0;
  m=Ncount/1000;
  w=Ncount%1000/100;
  q=Ncount%1000%100/10;
  b=Ncount%1000%100%10;
}
void display(void)
    {if(TF1==1)
     {TF1=0;
          TH1=aq;
      TL1=bq;
        bintobcd();
         TH0=0x00;
     TL0=0x00;
     write_com(0xc0);
     write_data('F');
         write_data(':');
    write_com(0xc7);
   write_data(m+0X30);  
    write_data(w+0X30);
    write_data(q+0X30);
    write_data(b+0X30);
    write_com(0xce);
     write_data('H');
     write_data('Z');
                     }
        display();
        }                       
  void main(void)
{
   init();
   init1();
   while (1)
  {  
  delay(15);
     display();
  }
}

举报

回复
*滑块验证:
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

打开支付宝扫一扫,最高立得1212元红包
搜索

图文热点

更多

社区学堂

更多

客服中心

QQ:187196467 服务时间:周一至周日 8:30-20:30

关注我们

关于我们
关于我们
友情链接
联系我们
帮助中心
网友中心
购买须知
支付方式
服务支持
资源下载
售后服务
定制流程
关注我们
官方微博
官方空间
官方微信
快速回复 返回顶部 返回列表