How do I simulate an abort/halt?

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
gtc
Posts: 69
Joined: Mon Mar 23, 2015 5:34 am
Has thanked: 30 times
Been thanked: 15 times
Contact:

How do I simulate an abort/halt?

Post by gtc »

(Version 6.1.3.2)

My application has an emergency STOP button and I need the program to abort upon pressing of that button.

I have INT0 on the chip assigned to the STOP button and a small interrupt routine associated with it.

To avoid having to test an interrupt status flag in many places throughout the program I was hoping to use a Connect to jump to the END label, but apparently the scope of Connect is local as I cannot see the associated connection point label in Main from within the interrupt routine.

Note: at this stage of development the need for a program abort/halt is within simulation mode so that I can demonstrate the prototype.

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: How do I simulate an abort/halt?

Post by kersing »

The code at the end of your program is just an infinite loop, if all you want to do is to permanently (until reset/power cycle) halt execution of you code you can just insert a never ending loop (loop with condition always true) in your interrupt routine.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

gtc
Posts: 69
Joined: Mon Mar 23, 2015 5:34 am
Has thanked: 30 times
Been thanked: 15 times
Contact:

Re: How do I simulate an abort/halt?

Post by gtc »

Good idea. Many thanks.

Post Reply