annotate target-utils/simtest/poll.c @ 1014:961efadd530a default tip

fc-shell TCH DL handler: add support for CSD modes TCH DL capture mechanism in FC Tourmaline firmware has been extended to support CSD modes in addition to speech - add the necessary support on the host tools side. It needs to be noted that this mechanism in its present state does NOT provide the debug utility value that was sought: as we learned only after the code was implemented, TI's DSP has a misfeature in that the buffer we are reading (a_dd_0[]) is zeroed out when the IDS block is enabled, i.e., we are reading all zeros and not the real DL bits we were after. But since the code has already been written, we are keeping it - perhaps we can do some tests with IDS disabled.
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 26 Nov 2024 06:27:43 +0000
parents d96ea6ae6aa5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
454
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 #include <sys/types.h>
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 #include <strings.h>
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 #include "types.h"
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 #include "simregs.h"
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 extern int serial_in_poll();
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 int enable_poll;
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 void
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 poll_sim_rx()
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 {
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 u32 drx;
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14
457
d96ea6ae6aa5 simtest: setup implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 454
diff changeset
15 if (SIMREGS.stat & SIM_STAT_FEMPTY)
454
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 return;
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 drx = SIMREGS.drx & 0xFF;
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 printf("%02X ", drx);
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 }
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 int
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 mygetchar()
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 {
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 register int c;
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 do {
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 if (enable_poll)
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 poll_sim_rx();
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 c = serial_in_poll();
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 }
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 while (c < 0);
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 return c;
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 }
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 void
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 cmd_poll(argbulk)
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 char *argbulk;
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 {
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 char *argv[2];
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 if (parse_args(argbulk, 1, 1, argv, 0) < 0)
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 return;
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 if (!strcmp(argv[0], "on"))
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 enable_poll = 1;
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 else if (!strcmp(argv[0], "off"))
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 enable_poll = 0;
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 else
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 printf("ERROR: \"on\" or \"off\" argument expected\n");
daaab2701761 target-utils: simtest program started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 }