comparison target-utils/libcommon/defgetchar.c @ 519:f9d2ce6591b7

target-utils: default mygetchar() added to libcommon
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 02 Jun 2019 23:59:12 +0000
parents
children
comparison
equal deleted inserted replaced
518:372757bb62e4 519:f9d2ce6591b7
1 /*
2 * The interactive command entry (editing) function in libcommon
3 * will call mygetchar() for its character input. It is supposed
4 * to be a blocking wait for input, but in some programs other
5 * processing can be done while waiting - for example, check for
6 * keypad presses as well. This is the basic version which waits
7 * for serial input and nothing else - specific programs can
8 * override it if necessary, but this library version is the default.
9 */
10
11 extern int serial_in_poll();
12
13 int
14 mygetchar()
15 {
16 register int c;
17
18 do
19 c = serial_in_poll();
20 while (c < 0);
21 return c;
22 }