Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: clrTerm.cpp
- Revision:
- 116:8990686eedf5
- Parent:
- 115:6ba84689e2c9
--- a/clrTerm.cpp Wed Oct 13 13:08:42 2021 +0000 +++ b/clrTerm.cpp Sun Oct 17 02:15:18 2021 +0000 @@ -1,13 +1,21 @@ /* File: clrTerm.cpp -This function uses ANSI/VT100 escapse sequences to clear the terminal. +This function uses ANSI/VT100 escapse sequences to clear the terminal. Serial +object must be passed by reference (since it is physically unique and can't be +copied). The call will look normal (clrTerm(pc)) as does the usage of pc here. Created by Dr. C. S. Tritt -Last revised: 10/13/21 (v. 1.0) +Last revised: 10/16/21 (v. 1.0) */ + +// Need for mbed use. #include "mbed.h" -void clrTerm(Serial *termPort){ +// Including the myFuncs.h header here will catch mismatches between the +// declaration and the definition. +#include "myFuncs.h" + +void clrTerm(Serial & pc){ const char ESC = 27; // Define escape character for escape sequence. - termPort->printf("%c[2J%c[H", ESC, ESC); // ANSI/VT100 clear screen/home. + pc.printf("%c[2J%c[H", ESC, ESC); // ANSI/VT100 clear screen/home. } \ No newline at end of file