Part Number: TMS320F28069
Other Parts Discussed in Thread: C2000WARE
Tool/software: Code Composer Studio
Hey,
Below are 2 structures. In the first one,stu[] is allocated to SRAM in the map file. Shouldn't this be in the flash?
In the 2nd case, stu[] is allocated to flash in the map file.
Our problem is that the structure is meant to have both const and unsigned int(for SRAM).But if initialized as const as in the 2nd case this is not possible. How to do this ie add a struct member for SRAM as in case 3.
case 1.
Struct para{
const unsigned int max;
const unsigned int min;
struct group{
const unsigned int scale;
const unsigned int dc;
}uni;
}stu[2]={
{.min=10,.min=2,{.scale=5,.dc=20}},
{.min=30,.min=2,{.scale=5,.dc=40}}
};
case 2.
Struct para{
const unsigned int max;
const unsigned int min;
struct group{
const unsigned int scale;
const unsigned int dc;
}uni;
}const stu[2]={
{.min=10,.min=2,{.scale=5,.dc=20}},
{.min=30,.min=2,{.scale=5,.dc=40}}
};
case 3
struct para{
const unsigned int max;
const unsigned int min;
unsigned int volt;
struct group{
const unsigned int scale;
const unsigned int dc;
}uni;
}const stu[2]={
{.min=10,.min=2,{.scale=5,.dc=20}},
{.min=30,.min=2,{.scale=5,.dc=40}}
};
Regards
Yash Shah