View previous topic :: View next topic |
Author |
Message |
j@qmail.com
Joined: 12 Nov 2003 Posts: 4
|
interrupts disabled during call @ADDFF |
Posted: Wed Mar 24, 2010 9:24 pm |
|
|
I have searched and can not find an answer on point. I compile my program and get this message:
Quote: |
>>> Warning 216 prog.c line 340(0.1)
interrupts disabled during call to prevent re-entrancy (@ADDFF)
|
That module (prog.c) only has 338 lines, there is no line 340 (there are other chunks of code in other files).
How can I discover which line of code is generating this message?
What function uses ADDFF ?
Tnx,
Jay |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Mar 24, 2010 9:48 pm |
|
|
It seems likely that you're doing an addition operation inside
an interrupt service routine. The code for this operation is
in a CCS "library" module. There is only one instance of it,
but you're using it in both main() and in the interrupt routine.
Therefore, CCS is disabling interrupts around the code in
main(), because their math library code is not re-entrant.
In other words, it can't be executed in main() and in the
interrupt routine at the same time.
See the comments by Ttelmah in this thread about warning messages:
http://www.ccsinfo.com/forum/viewtopic.php?t=41570
If you want to get rid of the warning, then read this thread
about using #org default:
http://www.ccsinfo.com/forum/viewtopic.php?t=33837
Another example:
http://www.ccsinfo.com/forum/viewtopic.php?t=25464&start=4 |
|
|
j@qmail.com
Joined: 12 Nov 2003 Posts: 4
|
Fixed |
Posted: Thu Mar 25, 2010 11:49 am |
|
|
All good,
Tnx,
Jay
|
|
|
vasiliok
Joined: 17 May 2011 Posts: 19 Location: Kaunas, Lithuania
|
|
Posted: Wed Feb 23, 2022 10:52 am |
|
|
I've got such an error when used "a = a+0.5" in the interrupt.
Probably using float variable in the interrupt is not a good idea
CCS 5.081 version. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19519
|
|
Posted: Wed Feb 23, 2022 11:11 am |
|
|
Yes. The 'FF' here is float. So it is a floating point addition used both
inside and outside the interrupt.... |
|
|
vasiliok
Joined: 17 May 2011 Posts: 19 Location: Kaunas, Lithuania
|
|
Posted: Wed Feb 23, 2022 11:13 am |
|
|
Ttelmah wrote: | Yes. The 'FF' here is float. So it is a floating point addition used both
inside and outside the interrupt.... |
Thanx for explanation! |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9229 Location: Greensville,Ontario
|
|
Posted: Wed Feb 23, 2022 1:16 pm |
|
|
generally speaking....
ISRs are supposed to be short and fast
OK to do these
set a couple 8 bit values
set a few flags
set a register or two
but NOT these...
no floating point
no fancy math (SIN,COS, etc..)
no printing
no complicated decisions
probably a few other 'rules'.....
a 'cheat' is to use a faster clock speed... |
|
|
|