Chat here about code rewrites, mods, etc... with respect to the github project https://github.com/esp8266/Arduino

Moderator: igrr

User avatar
By gatoruss
#76348 I know there must be something I am missing, but how does the code described at the following link use String to copy char array from flash?

https://circuits4you.com/2016/12/16/esp8266-web-server-html/

Whtyaren't the special attributed and function at the following link required?

https://github.com/esp8266/Arduino/blob/master/doc/PROGMEM.rst
User avatar
By McChubby007
#76389
btidey wrote:I didn't think that was the case for the esp8266.
See http://arduino-esp8266.readthedocs.io/e ... OGMEM.html

I agree. Must use PROGMEM. Same with Atmel328 (Uno etc).
I've made mistakes in the past with a table of pointers to strings, with the pointers going in PROGMEM and the strings in RAM.
Arduino Due on the other hand doesn't need PROGMEM and will happily put const strings in flash.
I would say in any case, for the sake on compatibility it is better to always use PROGMEM no matter what. The architectural settings can then decide whether to ignore or use PROGMEM (for instance a lot of my code is developed and runs on Linux as well as esp8266, so I just redefine PROGMEM on the linux compile).