keil5 仿真出现ERROR L121:IMPROPER FIXUP如何解决?,如题,用keil5仿真出现了ERROR L121:IMPROPER FIXUP的问题,第一次遇到,那个code也已经是large了,不知道怎么解决。
,源码呢?,
admin 发表于 2018-4-16 15:44
源码呢?
不好意思,才看到,真的不好意思。我把报错部分发上来。
#include “keyboard.h”
extern bit bdata flag_key;
//按键扫描函数 :
//功能;只扫描一个按键,按键为号小优先
//返回键值:
// 1 2 3 10 //10:清零重量,兼去皮功能
// 4 5 6 11 //11:清除单价
// 7 8 9 12 //12:显示数值偏大调节按键
// 14 0 15 13 //14:无功能(用于扩展)15:小数点 13:显示数值偏小调节按键
unsigned char Getkeyboard(void)
{
unsigned char number = 0;
unsigned char i;
//行输入低电平
ROW1=ROW2=ROW3=ROW4=0;
//如果列输出不全为高,则说明有键按下
if (((COL1!=1)||(COL2!=1)||(COL3!=1)||(COL4!=1))&&flag_key==1)
{
//输入0111
flag_key=0;
ROW1=0;
ROW2=ROW3=ROW4=1;
for (i=0;i<20;i++);
if (COL1==0) return 1; // 7
else if (COL2==0) return 2; // 8
else if (COL3==0) return 3; // 9
else if (COL4==0) return 10; // 10
//输入1011
ROW2=0;
ROW1=ROW3=ROW4=1;
for (i=0;i<20;i++);
if (COL1==0) return 4; //4
else if (COL2==0) return 5; // 5
else if (COL3==0) return 6; // 6
else if (COL4==0) return 11; // 11
//输入1101
ROW3=0;
ROW1=ROW2=ROW4=1;
for (i=0;i<20;i++);
if (COL1==0) return 7; //1
else if (COL2==0) return 8; // 2
else if (COL3==0) return 9; // 3
else if (COL4==0) return 12; // 12
//输入0111
ROW4=0;
ROW1=ROW2=ROW3=1;
for (i=0;i<20;i++);
if (COL1==0) return 14;
else if (COL2==0) return 0;
else if (COL3==0) return 15;
else if (COL4==0) return 13;
//没有检测到列低电平
return 99;
}
else if(COL1==1&&COL2==1&&COL3==1&&COL4==1)
flag_key=1;
return 99;
}
,I/O口有问题吧,重新拔插一下,
Liferme 发表于 2018-5-9 20:10
I/O口有问题吧,重新拔插一下
是在keil里不能编译成功,我同时还试了别的程序,正常的。
,楼主解决了嘛 遇到同样问题,bdata 问题 keil5 不认bdata,我今天也遇到了同样的问题,IMPROPER FIXUP,研究了半天终于解决了,原来这个问题是因为Keil4和Keil5不支持bdata的问题导致的,所以退回Keil2,新建工程,加入文件,重新编译就OK了,你这个上面也有bdata所以也可以用我的办法来成功解决的.
参考资料:
The variables ibase and bary are bit-addressable. Therefore, the individual bits of these variables may be directly accessed and modified. Use the sbit keyword to declare new variables that access the bits of bdata variables. For example:
sbit mybit0 = ibase ^ 0; /* bit 0 of ibase */
sbit mybit15 = ibase ^ 15; /* bit 15 of ibase */
sbit Ary07 = bary[0] ^ 7; /* bit 7 of bary[0] */
sbit Ary37 = bary[3] ^ 7; /* bit 7 of bary[3] */
The above example represents declarations, not assignments to the bits of the ibase and bary bdata variables. The expression following the carat symbol (‘^’) in the example specifies the position of the bit to access with this declaration. This expression must be a constant value.
The range depends on the type of the base variable included in the declaration. The range is:
0-7 for char and unsigned char, 0-15 for int, unsigned int,
short, and unsigned short, and
0-31 for long and unsigned long.
并没有定义bit类型的bdata。因此定义成char。
OFDM_PHY_ext char bdata bLib_RxPlcEnd;
OFDM_PHY_ext char bdata RX_BUSY;
OFDM_PHY_ext char bdata TX_BUSY;
Comm_ext char bdata bCommRxEnd;
Comm_ext char bdata bCommRxstart;