EEpromPointer

fve
 
Avatar
 
Betreff:

EEpromPointer

 · 
Gepostet: 07.07.2014 - 10:05 Uhr  ·  #1
Hi all,

I got some code from a colleague, when compiling, i notice i get errors when pointing to eeprom.

for example:

i have a boolean stored in eeprom:
Set_value[$08C8] : boolean;

UParaPntr : pointer;
UParaPntr:= (@Set_value);


The compiler givers me the error:
"Error: Pointer to EEprom not possible"

When my colleague compiles, everyting works fine.

I know i need to call a special function to get/set the value in eeprom using a pointer.
but it goes wrong when i make the pointer refere to the eeprom address..

Do i have to set some special bit to enable pointers to EEprom?

The only difference between my version and the one of my colleague is that he has a newer version of the compiler.
(i am working with revision 5.04.32, but when i read the changes since my version, i notice nothing about pointer to eeprom)

Regards,
Flor
fve
 
Avatar
 
Betreff:

Re: EEpromPointer

 · 
Gepostet: 08.07.2014 - 09:32 Uhr  ·  #2
Hi,

Is there anyone who has an idea why my compiler gives errors when using pointers to eeprom?
Was this functionality added in a later version of the compiler? After 5.04.32? (i supose not, since i find references in the documentation of my compiler..)

i'm using an atmega 2560..

Regards,
Flor
mc-electronic
Benutzer
Avatar
Geschlecht: keine Angabe
Herkunft: Sauerland NRW
Beiträge: 372
Dabei seit: 03 / 2008
Betreff:

Re: EEpromPointer

 · 
Gepostet: 08.07.2014 - 10:13 Uhr  ·  #3
Hi Flor,

the information you give is quite frugal. Anyway, I have added

{$EEPROM}
StructConst
Set_value[$08C8] : boolean = TRUE;

to my program header, I have added

{$IDATA}
Var
UParaPntr : pointer;

to my variable definition and I added into the source just before the main loop

UParaPntr:= (@Set_value);

Everything compiles fine. (ACRco 5.04.72) I have tried an older version of the compiler (5.04.24), and that compiled too.

For further investigation it would be helpful, if you post a full, tiny test program, that shows the error.

Michael
Merlin
Administrator
Avatar
Geschlecht:
Alter: 25
Beiträge: 1474
Dabei seit: 03 / 2005
Betreff:

Re: EEpromPointer

 · 
Gepostet: 08.07.2014 - 13:23 Uhr  ·  #4
Flor, just a quick question. You are not trying to store the pointer in EEPROM are you? That is what the error message suggests.
fve
 
Avatar
 
Betreff:

Re: EEpromPointer

 · 
Gepostet: 08.07.2014 - 16:21 Uhr  ·  #5
Hi Merlin,

No, i declaired my variable in eeprom,
The pointer is declaired in another unit, as a variable in ram...

the error "Pointer to EEprom not possible", referes to all the lines where i let the pointer point to the variables stored in eeprom..

unit E_Dec;
interface
{$IDATA}
const
.....

{$EEPROM}
var
...
Set_value[$08C8] : boolean;


---------------------------------------------

procedure xxx;
var
UParaPntr : pointer;
begin
UParaPntr:= (@Set_value);
end



But when i open the project in the old IDE, using version 5.04.32, i stell get the errors.

The good news is that i updated the software and now everything compiles as it should (5.04.77).
So i'll be working in version 5.04.77 from now on.

Thanks for looking into the problem anyway,

Regards,
Flor
Gewählte Zitate für Mehrfachzitierung:   0

Registrierte in diesem Topic

Aktuell kein registrierter in diesem Bereich

Die Statistik zeigt, wer in den letzten 5 Minuten online war. Erneuerung alle 90 Sekunden.
MySQL Queries: 15 · Cache Hits: 14   91   105 · Page-Gen-Time: 0.029159s · Speichernutzung: 2 MB · GZIP: ein · Viewport: SMXL-HiDPI