请指教,为什么编译时出错提示为"0xff:undefined identifier"

jasenwan 2010-08-15 04:07:30
#include<reg51.h>

sbit pos=P3^5;
sbit in_rev=P3^4;
sbit led_pos=P1^7;
sbit led_in_rev=P1^6;

sbit motor_in1=P1^2;
sbit motor_in2=P1^3;

void _nop_(void);

#define Nop _nop_()
#define uchar unsigned char
#define uint unsigned int

void dlyus(uchar count);
void dlyms(uchar count);
void dlys(uchar count);

uchar code IN1[0x04]={Oxff,0xff,0x00,0x00};
uchar code IN2[0x04]={0x00,0xff,0xff,0x00};


main()
{
uint allsteps = 0x274;
uchar step_pc =0;
// uchar motor_in1,motor_in2;


while(0x01)
{
if(allsteps == 0)
allsteps = 0x274;

if(pos ==1)
{ dlyms(0xc8); //防抖;
while(0x01)
{ led_pos =1;
motor_in1=IN1[step_pc];
motor_in2=IN2[step_pc];

step_pc++;

if(step_pc == 3)
step_pc =0;
if(!(allsteps--))
break;
dlyms(0xc8);
dlyms(0xc8);
}
}
if(in_rev == 1)
{

dlyms(0xc8);
while(0x01)
{
led_pos =1;
step_pc =0;
motor_in1=IN2[step_pc];
motor_in2=IN1[step_pc];

step_pc++;
allsteps--;
if(step_pc == 3)
step_pc =0;
if(!(allsteps--))
break;
dlyms(0xc8);
dlyms(0xc8);
}
}


}
}


void dlyus(uchar a)
{
while(a--)
{
Nop;
}
}

void dlyms(uchar a)
{
while(a--)
{
dlyus(0xc8);
}
}

void dlys(uchar a)
{
while(a--)
{
dlyms(0xc8);
dlyms(0xc8);
dlyms(0x64);
}
}
...全文
687 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
canshui 2010-08-15
  • 打赏
  • 举报
回复
[Quote=引用 13 楼 cattycat 的回复:]
字符和数字混了。不仔细看看不出来,看来使用好的编辑器很重要。
[/Quote]
推荐个吧……
cattycat 2010-08-15
  • 打赏
  • 举报
回复
字符和数字混了。不仔细看看不出来,看来使用好的编辑器很重要。
pang123hui 2010-08-15
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 jasenwan 的回复:]
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?_DLYS?MO;
通过编主对后提示此问题,是啥意思啊?
[/Quote]

L16的警告都是定义了函数没有被调用的问题,没什么,不用管它的
wang0635 2010-08-15
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 jasenwan 的回复:]
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?_DLYS?MO;
通过编主对后提示此问题,是啥意思啊?
[/Quote]

dlys函数没有被调用;警告;可以忽略
jasenwan 2010-08-15
  • 打赏
  • 举报
回复
楼上的能交个朋友不,我姓万,可以的话,加Q聊,:178775108;
jasenwan 2010-08-15
  • 打赏
  • 举报
回复
是的,我源码当中16行为空的啊;看样子下次写代码直接用代码编辑工具来做,像这样的问题就好查多了,
因为现在家里,没有烧录工具,只能回公司现调试了哦;不过谢谢你了;
ljhnew 2010-08-15
  • 打赏
  • 举报
回复
用ue或者vs编辑,都可以提示出来。注意,编写代码,最后用专业的编程工具,可以避免错误
angel_su 2010-08-15
  • 打赏
  • 举报
回复
现在ide的编辑器默认字体看不大出区别,变成要注意颜色...
ljhnew 2010-08-15
  • 打赏
  • 举报
回复
第16行警告,你这个是C51的程序吧。你的16行是哪行?贴的内容好像有问题。警告可以先不考虑警告,看看运行效果。
jasenwan 2010-08-15
  • 打赏
  • 举报
回复
搞定此问题,我半此份全部给你;谢谢
jasenwan 2010-08-15
  • 打赏
  • 举报
回复
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?_DLYS?MO;
通过编主对后提示此问题,是啥意思啊?
jasenwan 2010-08-15
  • 打赏
  • 举报
回复
谢谢,是把字母给打错了哦;
ljhnew 2010-08-15
  • 打赏
  • 举报
回复
你代码中的Oxff把“O”改为0,数字不是字母
jasenwan 2010-08-15
  • 打赏
  • 举报
回复
将sbit motor_in1 注释点,更改为uchar motor_in1;重新编译的话,结果仍然提示此处错误,请指教;

69,373

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧