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

Clarification on interrupt flag bit

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



Joined: 13 Jun 2011
Posts: 14
Location: NIGERIA

View user's profile Send private message

Clarification on interrupt flag bit
PostPosted: Sat Mar 24, 2012 6:44 am     Reply with quote

Please somebody tell me, does ccs have any function to check if interrupt flag bit is set? If yes what is it?

Which of these is correct: clear_interrupt(INTF) or clear_interrupt(INT_EXT) ?
Both will compile with PCM compiler.

What does the statement if(INTCON&(INTF)) mean?

My regards to all.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Mar 24, 2012 6:13 pm     Reply with quote

Quote:
Does ccs have any function to check if interrupt flag bit is set?

Download the CCS manual and view it:
http://www.ccsinfo.com/downloads/ccs_c_manual.pdf
Open up the Table of Contents window on the left side of the screen.
Click on this section: BUILT-IN-FUNCTIONS

Print those 4 or 5 pages. Then anytime you need a function, just look for
it in the list. For interrupts, look in the section on "Processor Controls".
You see the functions listed below. Read the manual and see if one of
them will tell you if the interrupt flag is set for the specified interrupt:
Code:

clear_interrupt( )
disable_interrupts( )
enable_interrupts( )
interrupt_active( )



Quote:
Which of these is correct: clear_interrupt(INTF) or clear_interrupt(INT_EXT) ?

This one is correct:
Code:

clear_interrupt(INT_EXT);



Quote:
What does the statement if(INTCON&(INTF)) mean?

That code is from the SourceBoost or Hi-Tech compiler, or some other
compiler. You won't normally see that in CCS. They are testing if
the External interrupt flag is set in the INTCON register. CCS does have
a function to do this. It's in the list that I posted earlier in my reply.
But normally, you don't need to test if an interrupt is active in CCS.
It's only needed in special situations.
ERICOO



Joined: 13 Jun 2011
Posts: 14
Location: NIGERIA

View user's profile Send private message

PostPosted: Wed Apr 18, 2012 2:08 pm     Reply with quote

Thanks a lot PCM PROGRAMMER you solved my problems.
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