J
Jimbo
I'm porting code from one embedded system to another.
Rather than declaring a pointer to memory/peripheral of interest and
dereferencing it, the original system had provisions for locating
variables at a specific address using proprietary c extensions.
The linker on the new tool set is all but inaccessible I'd I really
not rather modify the code to use a dereferenced pointer. The best I
can fathom is below:
typedef struct peripheral_tag
{
...
int some_val;
...
} peripheral;
#define P_ADD 0x1000
#define Peripheral_var (*((peripheral *)P_ADD))
So that in use, I'd have
Peripheral_var.some_val++;
If anyone considers this a revolting solution I'd appreciate they're
alternative.
Rather than declaring a pointer to memory/peripheral of interest and
dereferencing it, the original system had provisions for locating
variables at a specific address using proprietary c extensions.
The linker on the new tool set is all but inaccessible I'd I really
not rather modify the code to use a dereferenced pointer. The best I
can fathom is below:
typedef struct peripheral_tag
{
...
int some_val;
...
} peripheral;
#define P_ADD 0x1000
#define Peripheral_var (*((peripheral *)P_ADD))
So that in use, I'd have
Peripheral_var.some_val++;
If anyone considers this a revolting solution I'd appreciate they're
alternative.