Hi, I’m working on a looper and using the DSY_SDRAM_BSS section attribute on an array of floats to specify the array’s location in memory (to hold the loop itself). This was working when the array was a global variable, but I have since defined it as a member of a loopChannel class but this results in an error during upload: section attribute not allowed for ‘loop’. Classes (and C++ in general) are new to me so I’m not sure why I’d be getting this error. After trying some google searching, I’m still unable to find anything that has pointed me in the right direction.
My questions are
- Why does the array’s declaration as a member of the class or as a global variable make a difference to the section attribute?
- What would I have to do to place the loop array in the SDRAM memory while it is a member of the class?
Here is the relevant code:
class loopChan
{
public:
bool first;
bool rec;
bool recdd;
bool play;
bool reset;
int pos;
int mod;
int len;
int indexTracker;
float rateRemainder;
int pushVal;
float DSY_SDRAM_BSS loop[MAX_SIZE];
bool rvrs;
int stretch;
float lvl;
loopChan()
: first(true),
rec(false),
recdd(false),
play(false),
reset(false),
pos(0),
mod(MAX_SIZE),
len(0),
indexTracker(0),
rateRemainder(0.f),
pushVal(0),
rvrs(false),
stretch(100),
lvl(1.f)
{
// ClearBuffer
for (int i = 0; i < mod; i++) {
loop[i] = 0;
}
}
};