PROGMEM Reference documentation needs updating due to GCC changes #2647
Labels
Component: Documentation
Related to Arduino's documentation content
Type: Duplicate
Another item already exists for this topic
Was just putting together a new project, and the demo code used PROGMEM to save some SRAM space. It declared an array in memory for a image for the OLED display with the following initialiser...
However, that doesn't work with 1.6.0 when compiled for a Arduino Pro Mini /w Atmega328, and I would get the following error:
After some prodding around, either of the following lines do work correctly:
I saw a reference in the changelog at 1.5.7 Beta to "* avr: Fixed PROGMEM statements to be compatible with newer avr gcc (Scott Howard)" - and after finding the commit 33b1e7c I realised it was fixing the symptoms not the problem.
Can somebody update the reference page @ http://arduino.cc/en/Reference/PROGMEM (and thus also the bundled documentation!) as it now clear that the prog_char and prog_uchar (and probably none of the other) variables no longer work. And variables now need to be declared const also.
Just using
#define __PROG_TYPES_COMPAT__
as suggested in<avr/pgmspace.h>
will not work without also adding the const parameter. Plus this not really a fix as these typedefs are all deprecated.The text was updated successfully, but these errors were encountered: