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

PCD default interrupt handler

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







PCD default interrupt handler
PostPosted: Mon Mar 01, 2010 3:51 am     Reply with quote

On a dspic30F6012 using CCS PCD compiler.
If I define a default interrupt handler, inside that function can I use "interrupt_active(INT_RDA2)" to check if I have been called as a character is received on uart2?

Something like:
Code:

#int_default
void myISR(void)
{
    if interrupt_active(INT_RDA2)
    {
      doMyThing();
      clear_interrupt(INT_RDA2);
    }
}
Ttelmah
Guest







PostPosted: Mon Mar 01, 2010 5:19 am     Reply with quote

Basically, yes.
There are obviously 'caveats'. For exqample, if a a result of this, you call a getc, inside the interrupt handler, but you also want to use getc outside (since you are not really using an interrupt driven receive), you will get interrupts being disabled around the external getc. Remember also, that 'int_default', will only get called, if an interrupt has occured, and is enabled, and there is no handler present for this interrupt.....

Best Wishes
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon Mar 01, 2010 1:37 pm     Reply with quote

Strictly spoken, interrupt_active(INT_RDA2) doesn't tell, that the U2RX interrupt is being serviced. It means, that
INT_RDA2 is pending, but a different interrupt may be serviced first.
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