|
From: | Bjarne Laursen |
Subject: | Re: [avr-gcc-list] use of specifin RAM location |
Date: | Wed, 30 Nov 2005 10:49:43 +0100 |
User-agent: | Mozilla Thunderbird 0.7.3 (Windows/20040803) |
varsha wrote:
Hello all, I'm working on avr-gcc (GCC) 3.4.3 compiler and target MCU is Atmega 16i want to declare some variables, such that hey will take specific ram locations...for ex:
One way of doing this, is: 1: Write the adresse 2: Cast it to a pointer of the appropiate type 3: Dereference the pointer *((int*)0x1234) = 1; -- or -- typedef { char reg1; char reg1; } TDeviceX; ((TDeviceX*)0x1234)->reg1 = 255;Of cause, you should not allocate variables this way that is also allocated by the linked.
-Bjarne --
[Prev in Thread] | Current Thread | [Next in Thread] |