I am working on a program that utilizes the CLA (F28069). Originally, I had my algorithm running on the C28x core, and I used a lot of static variables within a function. They would be initialized once, then updated every time the function was called.
void foo(void) {
static int a=0;
static int b=0;
//... and so on
a++;
b++;
//... and so on
}
In order to port this over to the CLA, I realize I need to declare them as global variables in shared CLA2CPU RAM and initialize them in task8. However, there are too many variables to fit in this RAM location.
#pragma DATA_SECTION(a, "ClaToCpuMsgRAM"); #pragma DATA_SECTION(b, "ClaToCpuMsgRAM"); //... and so on
interrupt void Cla1Task1 (void)
{
//do stuff with a, b, ... and so on
}
interrupt void Cla1Task8 (void)
{
//initialize a, b, ... and so on
}
Within the CLA, I'd like to have the functionality of a static variable that I can update every time the task is run and have it retain it's value. But I'd like to do this without having to declare it as a global variable in shared CLA2CPU ram. I don't necessarily need the C28x core to have access to it. I'd also like to still be able to initialize it in task8. Is this possible?
Can I just declare them as static variables within the .cla file and use them in task1 and initialize them in task8?
static int a;
static int b;
//... and so on
interrupt void Cla1Task1 (void)
{
//do stuff with a, b, ... and so on
}
interrupt void Cla1Task8 (void)
{
a=0;
b=0;
//... and so on
}
Also, if implemented in this way, where are these variables stored??? In CLA scratchpad?