# HG changeset patch # User Mychaela Falconia # Date 1730095883 0 # Node ID c1d9b5d128f5b34117ed65d16691f2308c97bd47 # Parent 62579cfff4fc72c16d22f892b22e837c87fbc4f0 fc-mcsi-rxtx: implement print-rx command diff -r 62579cfff4fc -r c1d9b5d128f5 sw/mcsi-rxtx/rx_samples.c --- a/sw/mcsi-rxtx/rx_samples.c Mon Oct 28 06:02:04 2024 +0000 +++ b/sw/mcsi-rxtx/rx_samples.c Mon Oct 28 06:11:23 2024 +0000 @@ -22,3 +22,24 @@ rx_pcm_samples[n] = samp; } } + +void +cmd_print_rx() +{ + unsigned i, j, n; + + if (!is_active) { + printf("Rx is not active\n"); + return; + } + n = 0; + for (i = 0; i < 10; i++) { + for (j = 0; j < 16; j++) { + printf("%04x", rx_pcm_samples[n++]); + if (j == 15) + putchar('\n'); + else + putchar(' '); + } + } +} diff -r 62579cfff4fc -r c1d9b5d128f5 sw/mcsi-rxtx/usercmd.c --- a/sw/mcsi-rxtx/usercmd.c Mon Oct 28 06:02:04 2024 +0000 +++ b/sw/mcsi-rxtx/usercmd.c Mon Oct 28 06:11:23 2024 +0000 @@ -11,6 +11,8 @@ extern char usercmd[]; +extern void cmd_print_rx(); + static void cmd_exit() { @@ -25,6 +27,7 @@ void (*func)(); } cmdtab[] = { {"exit", 0, 0, cmd_exit}, + {"print-rx", 0, 0, cmd_print_rx}, {"quit", 0, 0, cmd_exit}, {0, 0, 0, 0} };