Forum Discussion
Altera_Forum
Honored Contributor
19 years agostruct
The following code works fine: # define RAMSHADOWBASE 0x01010000# define TESTVARIABLE (*(unsigned int*)RAMSHADOWBASE) Now I want to add a struct on the same way. Thus I want t...
Altera_Forum
Honored Contributor
19 years agoHi innotronics,
There are two common ways of accomplishing what (I believe) you want: 1, access the structure via a pointer:#define DEFSBASE 0x01010000
struct Defs *pDefs = (struct Defs *) DEFSBASE;
...
pDefs->Nr = <<whatever>> or ... 2. put the structure in a named section ...
struct Defs myDefs __attribute__ ((section (",defs")));
myDefs.Nr = <<whatever>> ... then locate the section where you want in your linker command file.__defs_start = .;
.defs :
{
*(.defs)
} Regards, --Scott