Skip to content

Commit 37e8bd6

Browse files
committed
README.md: add Termination section, for quitting inside the program
1 parent 7d37fa7 commit 37e8bd6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ The disadvantages are:
9696
* [Alternate Arduino Core](#AlternateArduinoCore)
9797
* [PlatformIO](#PlatformIO)
9898
* [Command Line Flags and Arguments](#CommandLineFlagsAndArguments)
99+
* [Termination](#Termination)
99100
* [Debugging](#Debugging)
100101
* [Valgrind](#Valgrind)
101102
* [Mock digitalRead() digitalWrite()](#MockDigitalReadDigitalWrite)
@@ -728,6 +729,25 @@ Usage: ./CommandLine.out [--help|-h] [-s] [--include word] [--] [words ...]
728729
A more advanced example can be seen in
729730
[AUnit/TestRunner.cpp](https://github.com/bxparks/AUnit/blob/develop/src/aunit/TestRunner.cpp).
730731

732+
<a name="Termination"></a>
733+
### Termination
734+
735+
A program running on a microcontroller will never terminate. But the EpoxyDuino
736+
version of that program running on the desktop may wish to do so. The
737+
recommended way to terminate is the following:
738+
739+
```C++
740+
#ifdef EPOXY_DUINO
741+
exit(0);
742+
#endif
743+
```
744+
745+
The exit handlers in EpoxyDuino will try to clean up the various terminal
746+
configurations into a sane state.
747+
748+
You should always be able to force the termination an EpoxyDuino program by
749+
hitting **Ctrl-C**.
750+
731751
<a name="Debugging"></a>
732752
### Debugging
733753

0 commit comments

Comments
 (0)