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
  • That's not true: it could be made to work
    agreed, however many threads where that was stated have gone on for miles before the beginner finally gave up.

    I do, occasionally, make 98% a hundered to get a point across.

    Erik

    PS I could "make it work" however I would not try, knowing the potential ramifications of any addition or change after it was made to work. This is one of those where a totally unrelated change/addition would result in failure

Reply
  • That's not true: it could be made to work
    agreed, however many threads where that was stated have gone on for miles before the beginner finally gave up.

    I do, occasionally, make 98% a hundered to get a point across.

    Erik

    PS I could "make it work" however I would not try, knowing the potential ramifications of any addition or change after it was made to work. This is one of those where a totally unrelated change/addition would result in failure

Children
No data