annotate target-utils/flash-boot-test/mygetchar.c @ 505:7bf0d909c87e

fc-loadtool flash ID check: change of reset after the check logic This change only affects those flash configurations that have ID checks enabled. The logic for resetting the flash after the ID check has been changed as follows: 1) If the check fails, we return without attempting to reset the flash. 2) If the check is successful, we reset the flash using the configured method (could be AMD or Intel or Intel W30) instead of always doing an AMD flash reset as the original code did.
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 27 May 2019 19:58:01 +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 }