[elektro] stack, struct copy

Fuzesi Arnold arnold.fuzesi.lista at gmail.com
Thu Apr 29 11:22:05 CEST 2010



On 2010. 04. 28. 18:34, Abraham Gabor wrote:
>> Abban mi a logika hogy
>>
>> extern volatile __eeprom CFG ee_cfg;
>> extern volatile CFG cfg;
>>
>>
>> cfg=ee_cfg masolast a fordito a stack-en vegzi???????????????????????????
>>
>> Van egy eepromban tarolt konfig struct-om amit az sram-ban levo 
>> konfig struct-ba 
>> szeretnek betolteni.
>>
>> Fordito meg kapasbol lefoglal a stack-ben egy CFG-nyi meretet a 
>> muveletnek. :(
> 
> C vagy C++ ?

C.


> Ennek ellenere az utobbi 20 evben nem lattam compilert,
> ami ne tudta volna. De, hogy hogy implementalja az mas kerdes.
> (Nem trivialis a feledat. Mi van, ha mondjuk mas az alignment
> a ket helyen.)

8 bites a uC...

Asszem rajottem a dologra.
"You can also override the supplied support functions to make the __eeprom memory
attribute access an EEPROM or flash memory that is placed externally but not on the
normal data bus, for example on an I2C bus.
To do this, you must write a new EEPROM library routines file and include it in 
your
project. The new file must use the same interface as the eeprom.s90 file in the
avr\src\lib\ directory (visible register use, the same entry points and the same
semantics)."

Szoval az __eeprom nem feltetlen kell legyen a belso eeprom...lehet egy kulso 
framtol kezdve barmi ha megirom az eeprom.s90-ben.
Valszeg emiatt kerult stack-re... hogy lehessen blokkosan irni olvasni, ne 
byte-onkent kinlodni.

A.



More information about the Elektro mailing list