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.
type
tNames = (none, Rolf, Thomas);
{$EEPROM}
structconst
EE_EnumArray : array[0..2] of tNames = (Thomas, Thomas, Thomas);
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.
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; 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
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