jcw/ethercard — pull request #91 by cversek (2013-06-19 06:28:49+00:00)
Title: Fix PROGMEM related compilation errors on newer versions of avr-gcc

Apparently, the use of the `PROGMEM` attribute is only valid for `const` type declarations in some newer versions of the `avr-gcc` compiler. Attempts to compile examples from the main-line `ethercard` library would result in errors like the following:
```
twitter.ino:29:16: error: variable ‘website’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
```
as confirmed using Arduino 1.0.3+dfsg-2 (Ubuntu 13.04) which uses the package gcc-avr 4.7.2-2.

This pull request implements a simple fix, adding the `const` keyword to all `PROGMEM` type declarations and function signatures containing `prog_char`. The fixes are believed to address this existing issue (https://github.com/jcw/ethercard/issues/11) and to be backwards compatible for older versions of avr-gcc.

A [similar pull request](https://github.com/jcw/ethercard/pull/23) also allows compilation to proceed, but suggested replacing `prog_char` datatypes with `const char`. However, these alternate changes might lead to "cryptic" bugs in handling pointers (ref. http://www.arduino.cc/en/Reference/PROGMEM), which is likely why that request was not merged. This should not be a problem with the changes herein. Note that the Arduino reference suggests using the `prog_`* datatypes even when declaring and initializing global variables using `PROGMEM` - these changes have not been made in this branch.