[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] prog_mem limitation?
From: |
Marc Wetzel |
Subject: |
[avr-gcc-list] prog_mem limitation? |
Date: |
Tue, 13 May 2008 11:36:25 +0200 |
User-agent: |
Thunderbird 2.0.0.14 (Windows/20080421) |
Hi,
I just found out the hard way, that the allocation of prog_mem variables
is not location independend.
So, if you alloc a variable outside of a function, e.g. in the
"standard" top area of your c-file, everything is working as expected.
But if you declare it inside a function, it does not work (as expected).
Working Example:
--
const prog_mem char teststring[]= "Teststring";
void * test(void) {
fprintf_P(uart, teststring);
}
--
Non-Working Example (but compiling fine):
--
void * test(void) {
const prog_mem char teststring[]= "Teststring";
fprintf_P(uart, teststring);
}
--
Is this the intended behaviour?
What cause is here the trigger?
TIA
Marc
- [avr-gcc-list] prog_mem limitation?,
Marc Wetzel <=
- Re: [avr-gcc-list] prog_mem limitation?, Mark Litwack, 2008/05/13
- Re: [avr-gcc-list] prog_mem limitation?, Mark Litwack, 2008/05/13
- Re: [avr-gcc-list] prog_mem limitation?, Bob Paddock, 2008/05/13
- Re: [avr-gcc-list] prog_mem limitation?, Marc Wetzel, 2008/05/13
- Re: [avr-gcc-list] prog_mem limitation?, Bob Paddock, 2008/05/13
- Re: [avr-gcc-list] prog_mem limitation?, Mark Litwack, 2008/05/13