comparison target-utils/simagent/byterx.c @ 771:9c1d580b50fb

simagent: Rx byte timeout test implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 12 Mar 2021 20:39:18 +0000
parents
children badc5399d641
comparison
equal deleted inserted replaced
770:81f9e4b4f55c 771:9c1d580b50fb
1 #include <stdlib.h>
2 #include "types.h"
3 #include "simregs.h"
4
5 rx_sim_byte(count)
6 unsigned count;
7 {
8 for (; count; count--) {
9 if (!(SIMREGS.stat & SIM_STAT_FEMPTY))
10 return SIMREGS.drx;
11 }
12 return(-1);
13 }
14
15 void
16 cmd_sertimeout(argbulk)
17 char *argbulk;
18 {
19 char *argv[2];
20 int count;
21
22 if (parse_args(argbulk, 1, 1, argv, 0) < 0)
23 return;
24 count = atoi(argv[0]);
25 rx_sim_byte(count);
26 }