|
|
View previous topic :: View next topic |
Author |
Message |
srlevitt2 Guest
|
PCD default interrupt handler |
Posted: Mon Mar 01, 2010 3:51 am |
|
|
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
|
|
Posted: Mon Mar 01, 2010 5:19 am |
|
|
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
|
|
Posted: Mon Mar 01, 2010 1:37 pm |
|
|
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. |
|
|
|
|
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
|