|
|
View previous topic :: View next topic |
Author |
Message |
cchappyboy
Joined: 03 Dec 2008 Posts: 45
|
Compile Problem |
Posted: Fri Jan 08, 2010 10:30 am |
|
|
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
|
|
Posted: Fri Jan 08, 2010 10:42 am |
|
|
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: 21708
|
|
|
|
|
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
|