I'm using a pic16F688 and it has 7k of program memory. When I try to create an array of structs, hi-tech C lite in Mplab tells me that there is not enough space to allocate.
struct s_RhythmPattern
{
unsigned char Meter; // how many beats in measure. 2/3/4/5/6...
char Name[8]; // the name of the rhthym
unsigned char Measures; // how many measures in the pattern
unsigned int Rhythm; // The rythm pattern, 1 is beat, 0 is no beat
} ;
struct s_RhythmPattern Rhythms[7];
//struct s_RhythmPattern Rhythms2[6];
The struct should have 96 bytes of data
When I declare an array of size 7, (672bytes) it gives an error saying not enough memory.
But I can create 2 or even 3 arrays of size 6 without any error as long as its lower than 7. Does it try to allocate a continuous block of memory? How can I get by this?
struct s_RhythmPattern
{
unsigned char Meter; // how many beats in measure. 2/3/4/5/6...
char Name[8]; // the name of the rhthym
unsigned char Measures; // how many measures in the pattern
unsigned int Rhythm; // The rythm pattern, 1 is beat, 0 is no beat
} ;
struct s_RhythmPattern Rhythms[7];
//struct s_RhythmPattern Rhythms2[6];
The struct should have 96 bytes of data
When I declare an array of size 7, (672bytes) it gives an error saying not enough memory.
But I can create 2 or even 3 arrays of size 6 without any error as long as its lower than 7. Does it try to allocate a continuous block of memory? How can I get by this?