本帖最后由 thinkingpadcui 于 2019-9-10 16:24 编辑
#pragma location="LCD_region"
char lcd_buffer[8][256];
#pragma location="BG_region"
long lcd_points[8*256*8]
这段代码在IAR下能正常运行,移植到keil5上面就报warning;
keil环境下可以用什么代码代替这四段代码!在线等
gui\LCD\lcd.c(18): warning: #161-D: unrecognized #pragma
这两个数组应该是定义12864LCD RAM的
void drawPoint(short x, short y, char value)
{
unsigned short location;
assert( (x<132));assert((y<64));
assert( x>=0); assert((y>=0));
location= y&0x7;
location +=(y>>3)<<11;
location += (x<<3);
lcd_points[location]=value;
}
void paintRect(short x0, short y0, short x1, short y1)
{
char *pchar;
char temp_x0;
y0 =y0>>3;
y1 =(y1+7)>>3;
for(;y0<=y1;y0++)
{
WriteCommand(0xb0 | (y0));
WriteCommand(0x10 | (x0>>4));
WriteCommand(0x0F & (x0));
WriteCommand(0xE0);
pchar = &lcd_buffer[y0][x0];
temp_x0=x0;
for(;temp_x0<=x1;temp_x0++){
WriteData(*pchar++);
}
}
}这个两个数组只用在这两个函数里面 然后这两个函数被LCD底层驱动函数调用
下面是IAR .icf文件内容 在keil里面 应该怎么实现
#define symbol __ICFEDIT_region_RAM_LCD_start__ = 0x20004000;
#define symbol __ICFEDIT_region_RAM_LCD_end__ = 0x20004FFF;
#define symbol __ICFEDIT_region_RAM_BG_start__ = 0x22080000;
#define symbol __ICFEDIT_region_RAM_BG_end__ = 0x2208FFFF;
#define region LCD_region = mem:[from __ICFEDIT_region_RAM_LCD_start__ to __ICFEDIT_region_RAM_LCD_end__];
#define region BG_region = mem:[from __ICFEDIT_region_RAM_BG_start__ to __ICFEDIT_region_RAM_BG_end__];
|