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

disable one interrupt from another interrupt routine

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







disable one interrupt from another interrupt routine
PostPosted: Tue Dec 24, 2002 4:10 am     Reply with quote

<font face="Courier New" size=-1>I was trying to do the following on a 18F452 does it make sense?
Does the diable_interrupts fuction work within an intterupt routine, and can it be used without the disable_interrupts(global)?

#int_RDA
RDA_isr()
{

char ch;
enable_interrupts(INT_TIMER2); // enable timer 2 interrupt
set_timer2(0);
timer_timeout = FALSE;

ch = getc();
}


#int_TIMER2
TIMER2_isr() {

timer_timeout = TRUE;
disable_interrupts(INT_TIMER2); // disable this interrupt untill another character is received.

}


// Happy Christmas!</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 10250
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: disable one interrupt from another interrupt routine
PostPosted: Tue Dec 24, 2002 12:57 pm     Reply with quote

<font face="Courier New" size=-1>I did something similar on a 16C77, in which I had an interrupt
driven keypad routine. When a key was pressed, an INT_RB would
occur. In the INT_RB isr, I started a timer and enabled
interrupts for it. This provided the debounce delay.
When the timer interrupt occurred, I disabled its interrupt,
re-enabled the INT_RB (which I had disabled in the INT_RB isr),
and read the keypad. GLOBAL interrupts were always enabled.


</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 10253
PCM Novice
Guest







Re: disable one interrupt from another interrupt routine
PostPosted: Fri Dec 27, 2002 2:31 pm     Reply with quote

'Sounds like it may work. I'll try it and hope that the 18F interrupt priorities don't cause problems.
Thanks

:=<font face="Courier New" size=-1>I did something similar on a 16C77, in which I had an interrupt
:=driven keypad routine. When a key was pressed, an INT_RB would
:=occur. In the INT_RB isr, I started a timer and enabled
:=interrupts for it. This provided the debounce delay.
:=When the timer interrupt occurred, I disabled its interrupt,
:=re-enabled the INT_RB (which I had disabled in the INT_RB isr),
:=and read the keypad. GLOBAL interrupts were always enabled.
:=
:=
:=</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 10273
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