[Top][All Lists]

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

Re: [avr-gcc-list] Extended SRAM access

From: Theodore Roth
Subject: Re: [avr-gcc-list] Extended SRAM access
Date: Tue, 2 Jul 2002 09:54:47 -0600 (MDT)

On Tue, 2 Jul 2002, Marek Michalkiewicz wrote:

:) The method of early initialization (MCUCR, WDTCR or anything else) is
:) different (and more flexible) in the current version.  Basically, write
:) a small assembler file which looks like this:
:) /* xram.S begin */
:) #include <io.h>
:)      .section .init1,"ax",@progbits
:)      ldi r16,_BV(SRE) | _BV(SRW)
:)      out _SFR_IO_ADDR(MCUCR),r16
:) /* xram.S end */

I've found that this also works from a C source file:

  void my_init (void) __attribute__ ((naked)) \
      __attribute__ ((section (".init1")));

  void my_init (void)
      /* your init code here; C or inline asm */

Ted Roth

avr-gcc-list at http://avr1.org

reply via email to

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