FreeCalypso > hg > freecalypso-tools
comparison target-utils/simagent/byterx.c @ 782:badc5399d641
simagent: flush_rx_fifo() factored out
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 13 Mar 2021 21:39:34 +0000 |
parents | 9c1d580b50fb |
children | c136a1a2474b |
comparison
equal
deleted
inserted
replaced
781:289733ff272b | 782:badc5399d641 |
---|---|
10 return SIMREGS.drx; | 10 return SIMREGS.drx; |
11 } | 11 } |
12 return(-1); | 12 return(-1); |
13 } | 13 } |
14 | 14 |
15 flush_rx_fifo() | |
16 { | |
17 unsigned count; | |
18 | |
19 for (count = 0; ; ) { | |
20 if (SIMREGS.stat & SIM_STAT_FEMPTY) | |
21 break; | |
22 (void) SIMREGS.drx; | |
23 if (++count >= 32) { | |
24 printf("ERROR: Rx FIFO flush does not end\n"); | |
25 return(-1); | |
26 } | |
27 } | |
28 return(0); | |
29 } | |
30 | |
15 void | 31 void |
16 cmd_sertimeout(argbulk) | 32 cmd_sertimeout(argbulk) |
17 char *argbulk; | 33 char *argbulk; |
18 { | 34 { |
19 char *argv[2]; | 35 char *argv[2]; |