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 support@ccsinfo.com

Compile Problem

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



Joined: 03 Dec 2008
Posts: 45

View user's profile Send private message

Compile Problem
PostPosted: Fri Jan 08, 2010 10:30 am     Reply with quote

When I compile my project it shows warning like this.

Interrupts disabled during call to prevent re-entrancy: (@DIV88)

I don't even know what is that mean. Please give me a help. Thanks
Ttelmah
Guest







PostPosted: Fri Jan 08, 2010 10:42 am     Reply with quote

A search here would find stuff about this.
Key to understand, the PIC, has no register stack. As such, there is no ability to temporarily store working values, if you call a function inside itself (re-entrancy).
Now the message is saying that you are performing 8bit division inside an interrupt, and also outside. Hence the compiler disables interrupts around the external 'copy' to prevent the same maths operation from being called inside itself, and disaster....

Comments. Generally, avoid maths in interrupts, especially division. Interrupt handlers should be as fast as possible. Search here about this. Even a single 8bit division, takes 354 machine cycles....
If you _must_, and want to prevent the error message, it is possible, by loading a second copy of the arithmetic code. A search here will again find details of how to do this.
However unless the timing is really critical, and if you really do need to do the maths, then just let the compiler apply the fix.

Best Wishes
PCM programmer



Joined: 06 Sep 2003
Posts: 18015

View user's profile Send private message

PostPosted: Fri Jan 08, 2010 1:46 pm     Reply with quote

Here is one of the previous threads that Ttelmah referred to:
http://www.ccsinfo.com/forum/viewtopic.php?t=33837
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