Gast
#429834
Hallo,
Ich habe ein Problem mit avr-gcc. Ich habe folgenden auszug aus dem
Programmcode :
#include <stdio.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <string.h>
void uart_putc(unsigned char c)
{
while (!(UCSRA & (1<<UDRE)));
UDR = c;
}
void uart_puts (char *s)
{
while (*s)
{
uart_putc(*s);
s++;
}
}
char Text_Init0[] PROGMEM = "Init "; // im Flash
char Text_Init1[] = "Init "; // im Ram
int main(void)
{
uart_puts (Text_Init0);
uart_puts (Text_Init1);
}
Beim Senden des Strings im Ram ist alles klar. Aber das Senden des
Strings im Flash führt zu einer Warnung des Compilers: "main.c:26:
warning: passing arg 1 of `uart_puts' discards qualifiers from pointer
target type".
Weiss einer was ich falsch mache?
Gruß Topsoft