|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2007-8-16 17:27:22
|
显示全部楼层
谢谢ATmega32的指点,已经编译通过, 但现在我想用一个函数实现显示,又出现警告,除非把show_zk1定义到RAM,告警消失.麻烦你帮我
看看:
#include <avr/pgmspace.h>
#define pgm8(A) (typeof((A)))pgm_read_byte(&(A))
#define pgm16(A) (typeof((A)))pgm_read_word(&(A))
#define pgm32(A) (typeof((A)))pgm_read_dword(&(A))
const char *show_Buf[6];
const char str0[] PROGMEM="液晶显示一";
const char str1[] PROGMEM="液晶显示2";
const char str2[] PROGMEM="液晶显示3";
const char str3[] PROGMEM="液晶显示4";
const char *show_zk1[4] PROGMEM={str0,str1,str2,str3};
void LCM_show(const char *sstr[])
{
unsigned char i;
for(i=0;i<4;i++)
show_Buf=pgm16(sstr);
}
int main(void)
{
LCM_show(show_zk1);
while(1);
}
编译后有:
myLCD-5.c:26: warning: passing arg 1 of `LCM_show' discards qualifiers from pointer target type
在FLASH中定义的指针数组, 用函数的行参如何调用呢! |
|