summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-07-16 20:38:19 -0700
committerJosh Blum <josh@joshknows.com>2010-07-16 20:38:19 -0700
commit8a7a824848f0a6276c0dc209bbd3ceeeb1eb7bd5 (patch)
tree6f056783fc9ba93bbf834bea77f7e25999756b03 /firmware
parentef0ca3b183c8526d5895ba918abffc9624bb2290 (diff)
downloaduhd-8a7a824848f0a6276c0dc209bbd3ceeeb1eb7bd5.tar.gz
uhd-8a7a824848f0a6276c0dc209bbd3ceeeb1eb7bd5.tar.bz2
uhd-8a7a824848f0a6276c0dc209bbd3ceeeb1eb7bd5.zip
usrp2: installed a simple dbsm_rx_inspector, it wont work without it...
Diffstat (limited to 'firmware')
-rw-r--r--firmware/microblaze/apps/txrx_uhd.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/firmware/microblaze/apps/txrx_uhd.c b/firmware/microblaze/apps/txrx_uhd.c
index b81d32b2d..f7f140121 100644
--- a/firmware/microblaze/apps/txrx_uhd.c
+++ b/firmware/microblaze/apps/txrx_uhd.c
@@ -97,6 +97,12 @@ static const uint32_t rx_ctrl_word = 1 << 16;
// DSP Rx writes ethernet header words
#define DSP_RX_FIRST_LINE sizeof(rx_ctrl_word)/sizeof(uint32_t)
+static bool dbsm_rx_inspector(dbsm_t *sm, int buf_this){
+ size_t num_lines = buffer_pool_status->last_line[buf_this]-DSP_RX_FIRST_LINE;
+ ((uint32_t*)buffer_ram(buf_this))[0] = (num_lines*sizeof(uint32_t)) | (1 << 16);
+ return false;
+}
+
// receive from DSP
buf_cmd_args_t dsp_rx_recv_args = {
PORT_DSP,
@@ -458,15 +464,12 @@ main(void)
dbsm_init(&dsp_rx_sm, DSP_RX_BUF_0,
&dsp_rx_recv_args, &dsp_rx_send_args,
- dbsm_nop_inspector);
+ dbsm_rx_inspector);
sr_tx_ctrl->clear_state = 1;
bp_clear_buf(DSP_TX_BUF_0);
bp_clear_buf(DSP_TX_BUF_1);
- buffer_ram(DSP_RX_BUF_0)[0] = rx_ctrl_word;
- buffer_ram(DSP_RX_BUF_0)[1] = rx_ctrl_word;
-
// kick off the state machine
dbsm_start(&dsp_tx_sm);