Tool/software: TI C/C++ Compiler
Currently I am working on a project where I am defining a set of variables in a '.c' file and then declaring those arrays in main file in a function like below
// this is the file where the functions are defined like this
const float v0[460] = {2314.556889, 2314.565559, ...};
const float v1[460] = {24.556889, 24.5659, ...};
const float v2[460] = {2554.556889, 24.55559, ...};
const float v3[460] = {254.55459, 2714.59, ...};
//this is my main file
//include libraries
void llshape()
//some global variables
void main(void)
{
//some statement
while (condition)
{
llshape();
}
}
void llshape(void)
{
extern float v0[460];
extern float v1[460];
extern float v2[460];
extern float v3[460];
//some calculations
}
I have gone through the theory of pragma directives and why they are used from this pdf : focus.ti.com/.../spru187q.pdf
So upon reading what I could understand is (what I am suppose to add is) this-
#pragma DATA_SECTION ( v0, "v0_sect")
float v0[460] = {...};
#pragma DATA_SECTION ( v1, "v1_sect")
float v1[460] = {...};
#pragma DATA_SECTION ( v2, "v2_sect")
float v2460] = {...};
#pragma DATA_SECTION ( v3, "v3_sect")
float v3[460] = {...};
But where do I add it? In the main file before main function?
And then in linker file, change the RAMGS3, 4, 5, 6 as
v0_sect: > RAMGS3, PAGE = 1
v1_sect: > RAMGS4, PAGE = 1
v2_sect: > RAMGS5, PAGE = 1
v3_sect: > RAMGS6, PAGE = 1
I feel there should be some way to not use so many RAMGSs. Please let me knowif I can assign these arrays to same RAMGS or a cluster of only 2-3 RAMGSs( because a single [460] array isn't going to take so much of space).
Regards,