AVR 的 __attribute__((progmem)) 在51下如何表达
unsigned int fill(unsigned int *buf, unsigned int pos, const char __attribute__((progmem)) *progmem_s){
char c;
while ((c = pgm_read_byte(progmem_s++)))
{
buf = c;
pos++;
}
return(pos);
}上面是AVR代码,我想progmem可以不用吧,直接SRAM运行,那么如何修改?我改这个明显错了.unsigned int fill(unsigned int *buf, unsigned int pos, const char *progmem_s)
{
char c;
while (c = progmem_s++)
{
buf = c;
pos++;
}
return(pos);
}
页:
[1]