Page 1 of 1

__flash as an alternative to PROGMEM

Posted: Sat Mar 15, 2014 7:02 pm
by ulao
Lots of talk on this with the new avr-gcc 4.7

No need for any #include and no need for any pgm_read*() nonsense. __flash is a new qualifier added to the language, it turns GCC support from explicit to implicit.

see here for more details.
http://www.avrfreaks.net/index.php?name ... 24#1144424

Any impact on v-usb if I made the changes?

Re: __flash as an alternative to PROGMEM

Posted: Tue Mar 18, 2014 1:56 am
by blargg
The main issue is that you make your code incompatible with older versions of GCC. Personally I've found the cost of using the older macro to be trivial in terms of clarity and finding bugs. It's not like this new approach magically makes functions work with pointers to flash, as a pointer to flash is a different and fundamentally incompatible type with a pointer to ram.