[BUG] EEPROM Zugrif

Thomas.AC
Benutzer
Avatar
Gender: n/a
Age: 43
Posts: 308
Registered: 07 / 2013
Subject:

[BUG] EEPROM Zugrif

 · 
Posted: 12.02.2016 - 14:22  ·  #1
Hallo,

Kein Schreibzugriff auf EEprom-Variable, wenn Typ "Array of enum" und structconst verwendet wird.
Im Assembler code fehlt der Aufruf der Eeprom System Rutine.

Code

type
    tNames = (none, Rolf, Thomas);
{$EEPROM}
structconst
    EE_EnumArray  : array[0..2] of tNames = (Thomas, Thomas, Thomas);


Code

program fattest;

Device = xmega128A4U, VCC = 3.3;

Import SysTick;

From System Import Longword;

Define
    OSCtype        = extXTAL=4096000, PLLmul=8, prescA=1, prescB=1, prescC=1,
                     overdrive, faildet;
    SysTick        = 10;
    StackSize      = 128, iData;
    FrameSize      = 256, iData;


Implementation

type
    tNames = (none, Rolf, Thomas);

{$EEPROM}

structconst
    EE_byte       : byte = 0;
    EE_ByteArray  : array[0..2] of byte = (0, 0, 0);
    EE_EnumArray  : array[0..2] of tNames = (Thomas, Thomas, Thomas);

{$IDATA}

begin
    EE_byte := 10;
    EE_ByteArray[0] := 10;
    EE_EnumArray[0] := Rolf;
end fattest.


Code

                        ; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                        ; Program body
                        ; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

                        .FUNC     $_Main, 0001Fh, 00020h
                        .ENTRYMAIN $
fattest.$_Main:

                        .BLOCK    31
                        .LINE     32
                        LDI       _ACCA, 00Ah
                        LDI       _ACCCLO, FATTEST.EE_BYTE AND 0FFh
                        LDI       _ACCCHI, FATTEST.EE_BYTE SHRB 8
                        CALL      SYSTEM.WriteEEp8
                        ADIW      _ACCCLO, 01h
                        .LINE     33
                        LDI       _ACCCLO, fattest.EE_ByteArray AND 0FFh
                        LDI       _ACCCHI, fattest.EE_ByteArray SHRB 8
                        LDI       _ACCA, 00Ah
                        CALL      SYSTEM.WriteEEp8
                        .LINE     34
                        LDI       _ACCCLO, fattest.EE_EnumArray AND 0FFh
                        LDI       _ACCCHI, fattest.EE_EnumArray SHRB 8
                        LDI       _ACCA, 001h
    hier fehlt was!          hier fehlt was!          hier fehlt was!
                        .ENDBLOCK 35
rh
Administrator
Avatar
Gender:
Location: Germany
Age: 24
Homepage: e-lab.de
Posts: 5558
Registered: 03 / 2002
Subject:

Re: [BUG] EEPROM Zugrif

 · 
Posted: 12.02.2016 - 14:50  ·  #2
Hallo Thomas,

Bug fixed. Update am WE.

rolf
Thomas.AC
Benutzer
Avatar
Gender: n/a
Age: 43
Posts: 308
Registered: 07 / 2013
Subject:

Re: [BUG] EEPROM Zugrif

 · 
Posted: 12.02.2016 - 15:29  ·  #3
danke schön
rh
Administrator
Avatar
Gender:
Location: Germany
Age: 24
Homepage: e-lab.de
Posts: 5558
Registered: 03 / 2002
Subject:

Re: [BUG] EEPROM Zugrif

 · 
Posted: 12.02.2016 - 15:56  ·  #4
ich habe zu Danken!
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 15 · Cache Hits: 14   81   95 · Page-Gen-Time: 0.057766s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI