PropWare  3.0.0.229
C++ objects and CMake build system for Parallax Propeller
term_cmd.c
1 /*
2  * @file term_cmd.c
3  *
4  * @author Andy Lindsay
5  *
6  * @version 0.85
7  *
8  * @copyright Copyright (C) Parallax, Inc. 2012. See end of file for
9  * terms of use (MIT License).
10  *
11  * @brief Send commands (0...14) to the SimpleIDE for various cursor
12  * control and miscellaneous commands.
13  *
14  * @detail Please submit bug reports, suggestions, and improvements to
15  * this code to editor@parallax.com.
16  */
17 
18 #include "simpletools.h"
19 
20 /*
21 void term_cmd(int termConst, ...)
22 {
23  terminal *term = simpleterm_pointer();
24  serial_txChar(term, (char) termConst);
25 
26  int max;
27  if(termConst == CRSRXY)
28  max = 2;
29  else if((termConst == CRSRX) || (termConst == CRSRY))
30  max = 1;
31  else
32  max = 0;
33 
34  va_list arg_ptr;
35  va_start(arg_ptr, termConst);
36  for(int args = 0; args < max; args++)
37  {
38  serial_txChar(term, (char) va_arg(arg_ptr, int));
39  }
40  va_end(arg_ptr);
41 }
42 */
43 
44 void term_cmd(int termConst, ...)
45 {
46  terminal *term = simpleterm_pointer();
47 
48  int max;
49  if(termConst == CRSRXY)
50  max = 2;
51  else if((termConst == CRSRX) || (termConst == CRSRY))
52  max = 1;
53  else
54  max = 0;
55 
56  //putChar(termConst);
57  serial_txChar(term, (char) termConst);
58 
59  va_list arg_ptr;
60  va_start(arg_ptr, termConst);
61  for(int args = 0; args < max; args++)
62  {
63  //putChar(va_arg(arg_ptr, int));
64  serial_txChar(term, (char) va_arg(arg_ptr, int));
65  }
66  va_end(arg_ptr);
67 }
68 
CRSRY
#define CRSRY
CRSRY character (15) sends SimpleIDE Terminal's cursor Y rows to the from its top edge.
Definition: simpletools.h:355
serial_txChar
int serial_txChar(serial *device, int txbyte)
Send a byte.
Definition: serial_rxtx.c:81
simpleterm_pointer
terminal * simpleterm_pointer(void)
Get default device pointer to SimpleIDE Terminal.
Definition: simpleterm.c:51
simpletools.h
This library provides convenient functions for a variety of microcontroller I/O, timing,...
term_cmd
void term_cmd(int termConst,...)
Send a command to SimpleIDE Terminal. Examples of commands include HOME, CLS, BKSP,...
Definition: term_cmd.c:44
CRSRX
#define CRSRX
CRSRX character (14) positions SimpleIDE Terminal's cursor X characters from the its left edge.
Definition: simpletools.h:347
text_struct
Structure that contains data used by simple text device libraries.
Definition: simpletext.h:81
CRSRXY
#define CRSRXY
CRSRXY character (2) sends cursor to a certain number of spaces over (X) and returns (Y) down from Si...
Definition: simpletools.h:243