Team,
We use MSP430FR6820 and need to create global variables on certain memory locations in RAM to be in a row without gaps.
There is definition of globalvar.h
#ifndef GLOBALVAR_H_ #define GLOBALVAR_H_ #pragma LOCATION(Var1ToSafe,0x1c51) char Var1ToSafe; #pragma LOCATION(Var2ToSafe,0x1c52) int Var2ToSafe; #pragma LOCATION(Var3ToSafe,0x1c54) int Var3ToSafe[4]; #pragma LOCATION(Var4ToSafe,0x1c5C) long Var4ToSafe; #endif
If I include this globalvar.h once, everything is O, but if I include this globalvar.h twice, I have errors:
Description Resource Path Location Type symbol "Var1ToSafe" redefined: first defined in "./adc2temp.obj"; redefined in "./main.obj" symbol "Var1ToSafe" redefined: first defined in "./adc2temp.obj"; redefined in "./main.obj" main.c /TestLinkovani C/C++ Problem
Please, can you give advice how to solve this problem?
(This globalvar.h is only example, I need declare 100 variables with diferent types and I can´t use structure or another solution of datatyping, I need variables in a row on the certain address in RAM).
Thanks for your feedback and help.
TI Customer