Joerg Wunsch schrieb:
As Georg-Johann Lay wrote:
If that static is not function-static, then __flash can be used:
Thanks for that, Johann.
I tried to come up with a __flash-based implementation myself,
but didn't get it to work.
Maybe your "recipe" would be worth an entry into the avr-libc FAQ?
Dunno if that's actually specified or just works by accident. What's
really strange is that it doesn't work for locals, and there is no
technical reason for that.
https://gcc.gnu.org/PR84163
Maybe it had just been overlooked when ASes were added to gcc, as the
first AS targets didn't go as far as avr (iirc they didn't even need
statics as it was all about using specific instructions for
memory-mapped I/O).
FWIF there's also a mention at
https://www.mikrocontroller.net/articles/AVR-GCC-Tutorial#Flash_mit_flash_und_Embedded-C
Johann
_______________________________________________
AVR-libc-dev mailing list
AVR-libc-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev