|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
stupid Array error: Error [1300] stack frame too l
It is choking on this declaration: `int table[255];`
I'm making it a lookup table. |
|
#2
|
|||
|
|||
|
Re: stupid Array error: Error [1300] stack frame too l
rom const int table[256];
Use that instead. Also, do you actually need int's? Do you values go above 255? Using unsigned char's would be more memory efficient |
|
#3
|
||||
|
||||
|
Re: stupid Array error: Error [1300] stack frame too l
Quote:
|
|
#4
|
||||
|
||||
|
Re: stupid Array error: Error [1300] stack frame too l
Quote:
what does the 'rom' part of it mean? |
|
#5
|
|||||
|
|||||
|
Re: stupid Array error: Error [1300] stack frame too l
Quote:
|
|
#6
|
|||||
|
|||||
|
Re: stupid Array error: Error [1300] stack frame too l
The linker will only allow you to define a total of 256 bytes of global (or static) variables within any single project file. Variables are located in Data space where the values can be changed whenever you like.
If you want to create "char table[255]", it'll need to be defined in a file off by itself that doesn't have any other global or static declarations and referenced as an extern. "int table[255]" is too large to be defined anywhere but within the much larger Program space. Using the keyword "rom" forces the array to be defined in (Read Only Memory) Program space rather than the Data memory, then you can be as large as you have program space for, but the values are fixed like your code statements and cannot be assigned or changed while your program is running. You have to pre-define the array values, e.g., Code:
rom const int table[255]={1,2,3,4,...255};
Also discussed in this thread. Last edited by Mark McLeod : 27-01-2006 at 15:56. |
|
#7
|
|||
|
|||
|
Re: stupid Array error: Error [1300] stack frame too l
See the appropriate sections in C18 Users Guide (see pointer in reply #45):
2.3 Storage Classes 2.4 Storage Qualifiers Quote:
I'm assuming this is in MPLab. The same thing can be done in EasyC either using the "User Code" option. See EasyC discussion in EasyC Wish List thread. Regards, DCBrown Last edited by dcbrown : 27-01-2006 at 11:18. |
|
#8
|
|||||
|
|||||
|
Re: stupid Array error: Error [1300] stack frame too l
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to Stack Tetras in Inventor | petek | Inventor | 0 | 13-01-2005 11:47 |
| Initial stack height | JJG13 | Rules/Strategy | 1 | 29-01-2003 21:04 |