CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

strange event

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mojsa2000



Joined: 18 May 2010
Posts: 78

View user's profile Send private message

strange event
PostPosted: Mon Jan 03, 2011 2:30 pm     Reply with quote

Hi
In the variables definition, when I comment some variables or delete them, the "out of ROM" message is shown. Why?

first:
Code:
static float energy,total_energy;
static float v_out,i_out;
static float hourly_positive_power=0,hourly_negative_power=0;
static float daily_positive_power,daily_negative_power;
static float hourly_Energy=0;
float daily_Energy=0;
float time_coeff=1; 
float v_buffer,i_buffer;
float v_dc,i_dc;

then:

Code:
static float energy,total_energy;
static float v_out,i_out;
//static float hourly_positive_power=0,hourly_negative_power=0;
//static float daily_positive_power,daily_negative_power;
static float hourly_Energy=0;
float daily_Energy=0;
float time_coeff=1; 
float v_buffer,i_buffer;
float v_dc,i_dc;

makes a "out of ROM " message.
Ttelmah



Joined: 11 Mar 2010
Posts: 19549

View user's profile Send private message

PostPosted: Mon Jan 03, 2011 2:39 pm     Reply with quote

This usually implies that removing the definition, makes the function smaller, so the compiler tries to put it 'inline', the resulting 'lump' of code is then too large to fit in a single memory page, so 'out of ROM'.
It is slightly odd, but the result of optimisation going too far, and the compiler being a little 'dumb' regarding memory pages.
Look at what subroutines are inside this function, and try declaring some of them as 'separate', and the problem should disappear.

Best Wishes
mojsa2000



Joined: 18 May 2010
Posts: 78

View user's profile Send private message

PostPosted: Mon Jan 03, 2011 3:23 pm     Reply with quote

thanks Ttelmah.
I'll do it.
best regards
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group