Re: hc12,can i return from interrupt and jump elsewhere?
- From: Robert Adsett <sub2@xxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 29 Sep 2007 12:42:10 -0400
In article <ssjsf35v96rt6b6shoti00qm6oo4issd5t@xxxxxxx>, Anton Erasmus
says...
On Sat, 29 Sep 2007 14:55:09 +0200, "blisca"
<bliscachiocciolinatiscali.it> wrote:
Hello from Milan ,Italy,
i'm programming a 9s12 uC in C language,with occasional assembly inserts;
the question is:
a function myfunc() is runnin,and an external events calls an interrupt
service routine,is it possible,once the interrupt did its job,to avoid to
continue with my func()
from the point where it was interruptd,and going back to main() instead?It
is not important if i have to run another couple of line in
myfunc().Important is that i can go out from it soon;
Can anyone suggest me the most elegant way?
Once more forgive my English.
If all you want is to restart your code, i.e. re-enter main from the
start, then you can use a watchdog reset. Just stop toggleing your
watchdog when you get your event. The watchdog will trigger, and
restart your micro. If you want to resume a sepcific function on
reception of an interrupt event, then this is less trivial. Unless you
want to write your own RTOS, the simplest is to use either one of the
many open source ones, or a commercial one.
http://www.freertos.org/ seem to have a port for your micro.
And if he is simple seeking to abort an operation setting a flag in the
interrupt routine and checking it in the routine you are interrupting is
fairly straightforward.
It seems an odd requirement. To the original poster, what is the effect
you are trying to achieve? Tell us what you are trying to do rather
than how you are proposing to do it. We might be able to suggest better
approaches.
Robert
--
Posted via a free Usenet account from http://www.teranews.com
.
- References:
- hc12,can i return from interrupt and jump elsewhere?
- From: blisca
- Re: hc12,can i return from interrupt and jump elsewhere?
- From: Anton Erasmus
- hc12,can i return from interrupt and jump elsewhere?
- Prev by Date: Re: PCB production: China or Taiwan?
- Next by Date: Re: hc12,can i return from interrupt and jump elsewhere?
- Previous by thread: Re: hc12,can i return from interrupt and jump elsewhere?
- Next by thread: Re: hc12,can i return from interrupt and jump elsewhere?
- Index(es):
Relevant Pages
|