keil编译时,提示入下错误:(我估计不应该是程序的错误,不知道哪里没有设置正确)
Build target 'Target 1'
assembling STARTUP.A51...
compiling Lcd.c...
C51 FATAL-ERROR -
ACTION: GOBAL OPTIMIZATION
FUNCTION: _ChineseChar
ERROR: CANNOT OPTIMIZE FUNCTION
COMPILATION TERMINATED.
use the following work-around:
#pragma OPTIMIZE (7)
/* your original function */
_ChineseChar () {
....
}
/* end of your original function */
#pragma OPTIMIZE (8)
Target not created
源程序如下,
//显示一个16x16汉字
void ChineseChar(uint x, uint y, uint For_color, uint Bk_color )
{
uchar temp;
uchar pos,t;
uchar CHAR_W,CHAR_H;
CHAR_W=16;
CHAR_H=16;
LCD_SetRamAddr(x,x+CHAR_W-1,y,y+CHAR_H-1);
for(pos=0;pos<32;pos++)
{
temp=hz16_1[pos];
for(t=0;t<8;t++)
{
if(temp&0x80)
LCD_Wirte_Data16(For_color); //textcolor
else
LCD_Wirte_Data16(Bk_color); //backcolor
temp<<=1;
}
}
}
此帖出自
小平头技术问答
降低优化级别试试,在C51一栏里
一周热门 更多>