restart function after interrupt

02 Oct 2012

Hi all,

I am trying to make a program that interrupts my main function. After the interrupt function has run, I want to restart the main function from the start, instead of just continuing where it stopped. How can I do this?

Thanks!

Ton

02 Oct 2012

The first thing that comes to mind is using the watch dog timer, and in the main function kick it regularly with a short (but appropriate) time and then in the interrupt just go into an infinite loop.

Ton Verra wrote:

Hi all,

I am trying to make a program that interrupts my main function. After the interrupt function has run, I want to restart the main function from the start, instead of just continuing where it stopped. How can I do this?

Thanks!

Ton

02 Oct 2012

Thanks for you answer, but wouldn't that reset all my values as well? I can perform a reset in the end of my interrupt, but by doing that all my value are gone..

I've solved it for now by speeding up the program after an interrupt is done, so that it FastForwards through the whole thing, but that isn't the best solution.

02 Oct 2012

Ton Verra wrote:

Thanks for you answer, but wouldn't that reset all my values as well? I can perform a reset in the end of my interrupt, but by doing that all my value are gone..

Yes, you're of course correct regarding the values. A small misunderstanding on my part... I was confused by "restart the main function from the start" and what you meant by that. Anyway, good you solved your issue.

Take care, Anthony