avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Variables in external ram


From: Joerg Wunsch
Subject: Re: [avr-gcc-list] Variables in external ram
Date: Sat, 6 Mar 2004 23:50:16 +0100 (MET)

As "Patrizio Zelotti" <address@hidden> wrote:

>Is possible to declare a section .noinit instead of declare the
>section for each variable ?

You could resort to assembler for the variable definitions, if you
really think it's worth the while.  In assembler, .section directives
stick until the next section directive.

Still, you'd need to provide a header file declaring the variables
then.

>For example
>... __attribute__ ((section (".noinit")))
>int a; // external ram variables
>long b;
>short c;
>... end section .noinit
>int c; // internal ram variables

Another option: use a CPP (C preprocessor) macro, like:

#define NI __attribute__ ((section (".noinit")))

...
int a NI;
long b NI;
short c NI;
-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/

_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list


reply via email to

[Prev in Thread] Current Thread [Next in Thread]