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

Interrupt termination

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







Interrupt termination
PostPosted: Mon Mar 24, 2008 1:22 am     Reply with quote

Hi!
Is it possible, to terminate an interrupt routine? I mean, I want to forget about the PCLATH and go to a completely different place, from where the ISR routine was called. I'm running a menu on the LCS screen. There are sub-functions, reachable by pushing buttons. The EXT interrupt is caused by one button (16F877 - B0). I want the isr to go back to the menu function. I can not do by calling it, because then it will run inside the isr (not running - using too much PCLATH). So, what is the solution?

Menu function:

Code:
void Menu()
{
   
   output_low(PIN_B5);
   output_low(PIN_B4);
   output_low(PIN_B3);
   lcd_putc("\f     Tesztpanel\n");
   lcd_putc("1:INT 2:ADC 3:LED");
   delay_ms(500);
while(1)
{
   if (!input(PIN_B1))
   ADC();
   if (!input(PIN_B2))
   LED();
}


ISR:
Code:

#int_EXT
void ISR()
{
//?????????????????
}

What to do to terminate everything, and go to the menu funct? Except reset_cpu(). Confused
Ttelmah
Guest







PostPosted: Mon Mar 24, 2008 3:10 am     Reply with quote

Write your main code, so it tests a flag, and calls the menu if this is set. Set the flag in the ISR.
Do a search here, a lot of examples have been posted in the past.

Best Wishes
Tom_HUN
Guest







PostPosted: Mon Mar 24, 2008 3:36 am     Reply with quote

Ttelmah wrote:
Write your main code, so it tests a flag, and calls the menu if this is set. Set the flag in the ISR.
Do a search here, a lot of examples have been posted in the past.

Best Wishes


Thanks fot the idea! It's working like charm! Very Happy

All the very best from Hungary!
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