Цитата(smk @ Apr 17 2008, 15:54)

Если я правильно понял, то так будет работать:
int my_variable __attribute__ ((section (".noinit"))); //объявляем глобальной
.
.
.
if (my_variable==10)
{
//показываем, что прибор работает
my_variable=0;
}
Все правильно?
Вот, что написано в мануале:
The .noinit SectionThis sections is a part of the .bss section. What makes the .noinit section special is that variables which are defined as such:
int foo __attribute__ ((section (".noinit")));
will not be initialized to zero during startup as would normal .bss data.
Only uninitialized variables can be placed in the .noinit section. Thus, the following code will cause avr-gcc to issue an error:
int bar __attribute__ ((section (".noinit"))) = 0xaa;
It is possible to tell the linker explicitly where to place the .noinit section by adding -Wl,--section-start=.noinit=0x802000 to the avr-gcc command line at the linking stage. For example, suppose you wish to place the .noinit section at SRAM address 0x2000:
$ avr-gcc ... -Wl,--section-start=.noinit=0x802000 ...
Note:
Because of the Harvard architecture of the AVR devices, you must manually add 0x800000 to the address you pass to the linker as the start of the section. Otherwise, the linker thinks you want to put the .noinit section into the .text section instead of .data/.bss and will complain.