annotate target-utils/pirexplore/mygetchar.c @ 642:b039cafc8e31

PCM integration: linking
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Wed, 03 Sep 2014 17:42:09 +0000
parents b8f335553000
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
67
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 * The interactive command entry (editing) function in libcommon
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 * will call mygetchar() for its character input. It is supposed
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 * to be a blocking wait for input, but in some programs other
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 * processing can be done while waiting - for example, check for
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 * keypad presses as well. This is the basic version which waits
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 * for serial input and nothing else.
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 */
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 extern int serial_in_poll();
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 int
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 mygetchar()
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14 {
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 register int c;
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 do
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18 c = serial_in_poll();
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19 while (c < 0);
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20 return c;
b8f335553000 pirexplore utility started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21 }