FreeCalypso > hg > fc-pcm-if
comparison sw/mcsi-rxtx/rx_samples.c @ 10:c1d9b5d128f5
fc-mcsi-rxtx: implement print-rx command
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 28 Oct 2024 06:11:23 +0000 |
parents | 62579cfff4fc |
children | 315428573a25 |
comparison
equal
deleted
inserted
replaced
9:62579cfff4fc | 10:c1d9b5d128f5 |
---|---|
20 for (n = 0; n < 160; n++) { | 20 for (n = 0; n < 160; n++) { |
21 samp = ((unsigned) sp[1] << 8) | ((unsigned) sp[0]); | 21 samp = ((unsigned) sp[1] << 8) | ((unsigned) sp[0]); |
22 rx_pcm_samples[n] = samp; | 22 rx_pcm_samples[n] = samp; |
23 } | 23 } |
24 } | 24 } |
25 | |
26 void | |
27 cmd_print_rx() | |
28 { | |
29 unsigned i, j, n; | |
30 | |
31 if (!is_active) { | |
32 printf("Rx is not active\n"); | |
33 return; | |
34 } | |
35 n = 0; | |
36 for (i = 0; i < 10; i++) { | |
37 for (j = 0; j < 16; j++) { | |
38 printf("%04x", rx_pcm_samples[n++]); | |
39 if (j == 15) | |
40 putchar('\n'); | |
41 else | |
42 putchar(' '); | |
43 } | |
44 } | |
45 } |