Where I'm going is this:
I suspect that you are perhaps new to embedded system programming, and are asking a perfectly logical, classical 'noob' question, "How do I get my program to stop, and wait for an input, and then start up again?" "When I program in a 'stop' command, it just stops, and never restarts."
The answer is, you write the program so it never, never, ever stops running, it just stops _appearing_ to do anything, but it really runs in a loop, constantly polling the input, i.e., asking the same switch, over and over, "Did the idiot out front do anything?", and repeating until it gets an answer different from "no".
I hope that helped, or at least didn't insult you.
Mike Halloran
Pembroke Pines, FL, USA