http://tuxgraphics.org/electronics
Content:
By Guido Socher |
avr-gcc, error: unknown type name 'prog_char'Abstract:
Avr-libc has removed in version 1.8 the datatype prog_char. That is: as of atmel avrtoolchain-3.2.4
you will not be able to compile a lot of older code. Almost all tuxgraphics code is affected
by this and we will update the code over time but it will take several month to do that.
|
Change this line: CFLAGS=-g -mmcu=$(MCU) -Wall -Wstrict-prototypes -Os -mcall-prologues To: CFLAGS=-g -mmcu=$(MCU) -Wall -Wstrict-prototypes -Os -mcall-prologues -Wno-deprecated-declarations -D__PROG_TYPES_COMPAT__
#include <avr/io.h> #include <avr/pgmspace.h> ... const char str_pstr[] PROGMEM = "FLASH STRING";A function that takes such a datatype would the need to look like this:
void lcd_puts_p(const char *progstr ) { char c; while ((c = pgm_read_byte(progstr++))) { lcd_putc(c); } }It is a good convention to call such a function that takes a string from program memory "_p" in its name.
lcd_puts_p(str_pstr);There is as well the possibility to use a macro (the macro is part of the avr-libc) that will create a program memory string on the spot without the need to declare an own variable at the top of your code:
lcd_puts_p(PSTR("tuxgraphics"));
2012-07-30, generated by tuxgrparser version 2.57