This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

8051- Returning from an interrupt to a fixed location

Hi everyone,
Is there a way to return to a fixed location from an interrupt?

In my program I have something like this:

void main(void)
{
        ...//some instructions

        while(1)
        {
                ...//some instructions

                EX1=1;    //enable external interrupt 1
                my_function();
                EX1=0;   //disable external interrupt 1
        }

}

As you can see, an external interrupt 1 can occur somewhere in the middle of my_function (or in the middle of other functions that my_function calls).
And I want that when we go back from the external interrupt 1 subroutine, the processor will go right to the beginning of while(1) and SKIP the rest of my_function (instead of returning to where it was called from).

Is there a way to do this?
(And by the way, I don't care about all the local variables of any of the functions or the main. They are all irrelevant if EX1 occurs, so there's no need to save them before "returning" to that location).

I'd really appreciate your help!!

Parents
  • If it can be coded, it's possible.

    sure it can be coded; however, since the result will be unpredictable non-debuggable and lead to increased sales of aspirin, it is equally possible to surviving being struck by lightning.

    Erik

    If I were you, I'd prepare for some flak from other posters!

    if advising against certain failure is 'flak' I am very proud of providing flak

Reply
  • If it can be coded, it's possible.

    sure it can be coded; however, since the result will be unpredictable non-debuggable and lead to increased sales of aspirin, it is equally possible to surviving being struck by lightning.

    Erik

    If I were you, I'd prepare for some flak from other posters!

    if advising against certain failure is 'flak' I am very proud of providing flak

Children
No data