annotate target-utils/flash-boot-test/mygetchar.c @ 416:30f6d1c32c6f

doc/Flash-boot-defect article removed (no longer relevant) This article is no longer relevant because the issue in question only affected one (1) defective FCDEV3B board which was not and never will be sold.
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 26 Oct 2018 07:11:08 +0000
parents dbb54db721d1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
197
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * The interactive command entry (editing) function in libcommon
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * will call mygetchar() for its character input. It is supposed
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 * to be a blocking wait for input, but in some programs other
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 * processing can be done while waiting - for example, check for
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 * keypad presses as well. This is the basic version which waits
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 * for serial input and nothing else.
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 */
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 extern int serial_in_poll();
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 int
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 mygetchar()
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 {
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 register int c;
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 do
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 c = serial_in_poll();
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 while (c < 0);
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 return c;
dbb54db721d1 target-utils/flash-boot-test written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 }