FreeCalypso > hg > freecalypso-tools
annotate target-utils/buzplayer/mygetchar.c @ 299:7fefa4f73c6a
c1xx-calextr: off-by-1 error in the Tx levels table conversion
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 18 Nov 2017 18:02:42 +0000 |
parents | 5bbba2cab6f3 |
children |
rev | line source |
---|---|
76
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * The interactive command entry (editing) function in libcommon |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * will call mygetchar() for its character input. It is supposed |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * to be a blocking wait for input, but in some programs other |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 * processing can be done while waiting - for example, check for |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 * keypad presses as well. This is the basic version which waits |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 * for serial input and nothing else. |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 */ |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 extern int serial_in_poll(); |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 int |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 mygetchar() |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 { |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 register int c; |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 do |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 c = serial_in_poll(); |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 while (c < 0); |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 return c; |
5bbba2cab6f3
target-utils: buzplayer started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 } |