FreeCalypso > hg > freecalypso-sw
annotate target-utils/pirexplore/mygetchar.c @ 473:658b141a1600
os_com_fl.c: small buglet in the reconstruction
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Fri, 27 Jun 2014 00:05:23 +0000 |
parents | b8f335553000 |
children |
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 } |