annotate target-utils/pirexplore/mygetchar.c @ 192:707aa640b2dc

fc-tmsh: w8/w16/w32 implemented
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 25 Nov 2013 05:37:46 +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 }