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

interrupts disabled during call @ADDFF

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
j@qmail.com



Joined: 12 Nov 2003
Posts: 4

View user's profile Send private message

interrupts disabled during call @ADDFF
PostPosted: Wed Mar 24, 2010 9:24 pm     Reply with quote

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: 21658

View user's profile Send private message

PostPosted: Wed Mar 24, 2010 9:48 pm     Reply with quote

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

View user's profile Send private message

Fixed
PostPosted: Thu Mar 25, 2010 11:49 am     Reply with quote

All good,
Tnx,
Jay
Very Happy
vasiliok



Joined: 17 May 2011
Posts: 19
Location: Kaunas, Lithuania

View user's profile Send private message

PostPosted: Wed Feb 23, 2022 10:52 am     Reply with quote

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 Smile

CCS 5.081 version.
Ttelmah



Joined: 11 Mar 2010
Posts: 18060

View user's profile Send private message

PostPosted: Wed Feb 23, 2022 11:11 am     Reply with quote

Yes. The 'FF' here is float. So it is a floating point addition used both
inside and outside the interrupt.... Sad
vasiliok



Joined: 17 May 2011
Posts: 19
Location: Kaunas, Lithuania

View user's profile Send private message

PostPosted: Wed Feb 23, 2022 11:13 am     Reply with quote

Ttelmah wrote:
Yes. The 'FF' here is float. So it is a floating point addition used both
inside and outside the interrupt.... Sad


Thanx for explanation!
temtronic



Joined: 01 Jul 2010
Posts: 8525
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Feb 23, 2022 1:16 pm     Reply with quote

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...
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