[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r7601 - usrp2/trunk/firmware/apps
From: |
eb |
Subject: |
[Commit-gnuradio] r7601 - usrp2/trunk/firmware/apps |
Date: |
Thu, 7 Feb 2008 14:21:34 -0700 (MST) |
Author: eb
Date: 2008-02-07 14:21:34 -0700 (Thu, 07 Feb 2008)
New Revision: 7601
Modified:
usrp2/trunk/firmware/apps/rx_only.c
usrp2/trunk/firmware/apps/tx_only.c
Log:
cleaned up some magic numbers
Modified: usrp2/trunk/firmware/apps/rx_only.c
===================================================================
--- usrp2/trunk/firmware/apps/rx_only.c 2008-02-07 21:09:47 UTC (rev 7600)
+++ usrp2/trunk/firmware/apps/rx_only.c 2008-02-07 21:21:34 UTC (rev 7601)
@@ -65,9 +65,7 @@
// 4 lines of ethernet hdr + 1 line transport hdr + 1 line (word0)
// DSP Rx writes timestamp followed by nlines_per_frame of samples
-#define DSP_RX_FIRST_LINE 6
-#define DSP_RX_SAMPLES_PER_FRAME 250
-#define DSP_RX_EXTRA_LINES 1 // writes timestamp
+#define DSP_RX_FIRST_LINE ((sizeof(u2_eth_hdr_t) +
sizeof(u2_transport_hdr_t))/4 + 1)
// receive from DSP
buf_cmd_args_t dsp_rx_recv_args = {
@@ -196,6 +194,7 @@
int rx_scale = 256;
int decim = 64;
+ int samples_per_frame = 250;
u2_mac_addr_t host = {{ 0x00, 0x0A, 0xE4, 0x3E, 0xD2, 0xD5 }};
op_start_rx_t def_config;
@@ -203,8 +202,8 @@
def_config.phase_inc = 0;
def_config.scale_iq = (rx_scale << 16) | rx_scale;
def_config.decim = decim;
- def_config.samples_per_frame = DSP_RX_SAMPLES_PER_FRAME;
- def_config.total_samples = 10000 * DSP_RX_SAMPLES_PER_FRAME;
+ def_config.samples_per_frame = samples_per_frame;
+ def_config.total_samples = 10000 * samples_per_frame;
start_rx_cmd(&host, &def_config);
}
Modified: usrp2/trunk/firmware/apps/tx_only.c
===================================================================
--- usrp2/trunk/firmware/apps/tx_only.c 2008-02-07 21:09:47 UTC (rev 7600)
+++ usrp2/trunk/firmware/apps/tx_only.c 2008-02-07 21:21:34 UTC (rev 7601)
@@ -58,12 +58,10 @@
* ================================================================
*/
-// 4 lines of ethernet hdr + + 1 line transport hdr + 2 lines (word0 +
timestamp)
+// 4 lines of ethernet hdr + 1 line transport hdr + 2 lines (word0 + timestamp)
// DSP Tx reads word0 (flags) + timestamp followed by samples
-#define DSP_TX_FIRST_LINE 5
-#define DSP_TX_SAMPLES_PER_FRAME 250 // not used except w/ debugging
-#define DSP_TX_EXTRA_LINES 2 // reads word0 +
timestamp
+#define DSP_TX_FIRST_LINE ((sizeof(u2_eth_hdr_t) +
sizeof(u2_transport_hdr_t))/4)
// Receive from ethernet
buf_cmd_args_t dsp_tx_recv_args = {
@@ -75,7 +73,7 @@
// send to DSP Tx
buf_cmd_args_t dsp_tx_send_args = {
PORT_DSP,
- DSP_TX_FIRST_LINE, // starts just past ethernet header
+ DSP_TX_FIRST_LINE, // starts just past transport header
0 // filled in from last_line register
};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r7601 - usrp2/trunk/firmware/apps,
eb <=