Thread: array problems
View Single Post
  #3   Spotlight this post!  
Unread 27-01-2006, 15:43
jerry w's Avatar
jerry w jerry w is offline
Free Agent Mentor
no team (Team Krunch)
Team Role: Engineer
 
Join Date: Nov 2003
Rookie Year: 2002
Location: dunedin fl
Posts: 113
jerry w has much to be proud ofjerry w has much to be proud ofjerry w has much to be proud ofjerry w has much to be proud ofjerry w has much to be proud ofjerry w has much to be proud ofjerry w has much to be proud ofjerry w has much to be proud ofjerry w has much to be proud of
Re: array problems

Quote:
Originally Posted by p1r0o2g7
Our team decided on using a lookup table to determine our cannons angle to accurately fire it at the target. I put the array into a function, lets say its called Find_Angle() just for reference. When compiled it gave me the error "Stack Frame too Large".

I searched on Google and found that declaring the array as a global variable would fix that problem but now the compiler is tell me...

"Error - section '.idata_tracking.o' can not fit the section. Section '.idata_tracking.o' length=0x00000524"

Anyone know why? I'm baffled.
you are placing the array into ram memory. since it is in a function, the memory is also assigned to the stack. there are less than 256 stack bytes available.
if you intended the array to be in program memory, use the ROM prefix. if it is to be in ram, use the STATIC prefix.
static, tells the compiler not to store the data into the stack.

jerry w
__________________
Happiest when people tell the truth... However, I am blessed with many friends.